Hi, I have a DirectAdmin server with NGNIX. After a few restores I get the following error:
Where nginx.conf says:
To be honest I have no clue what I am doing or how I can fix this. Can someone please help me?
Code:
root@cloud:~# service nginx restart
nginx: [emerg] duplicate location "/" in /usr/local/directadmin/data/users/mojo/nginx.conf:63
nginx: configuration file /etc/nginx/nginx.conf test failed
/etc/init.d/nginx: line 78: return: can only `return' from a function or sourced script
Shutting down nginx:
Starting nginx: nginx: [emerg] duplicate location "/" in /usr/local/directadmin/data/users/mojo/nginx.conf:63
Where nginx.conf says:
Code:
# Auto generated nginx config file by DirectAdmin version 1.49.1
# Modifying this file is not recommended as any changes you make will be
# overwritten when the user makes any changes to his/her website
# For global config changes that affect all Users, see this guide:
# http://help.directadmin.com/item.php?id=558
# For local config changes that only affect one User, see this guide:
# http://help.directadmin.com/item.php?id=3
server
{
listen 37.97.132.134:80;
server_name mojo.nl www.mojo.nl ;
access_log /var/log/nginx/domains/mojo.nl.log;
access_log /var/log/nginx/domains/mojo.nl.bytes bytes;
error_log /var/log/nginx/domains/mojo.nl.error.log;
root /home/mojo/domains/mojo.nl/public_html;
index index.php index.html index.htm;
include /usr/local/directadmin/data/users/mojo/nginx_php.conf;
include /etc/nginx/webapps.conf;
location /
{
rewrite ^.*/files/(.*)$ /wp-includes/ms-files.php?file=$1 last;
if (!-e $request_filename) {
rewrite ^(.+)$ /index.php?q=$1 last;
}
}
}
server
{
listen 37.97.132.134:443 ssl;
server_name mojo.nl www.mojo.nl ;
access_log /var/log/nginx/domains/mojo.nl.log;
access_log /var/log/nginx/domains/mojo.nl.bytes bytes;
error_log /var/log/nginx/domains/mojo.nl.error.log;
root /home/mojo/domains/mojo.nl/private_html;
index index.php index.html index.htm;
ssl on;
ssl_certificate /etc/nginx/ssl.crt/server.crt.combined;
ssl_certificate_key /etc/nginx/ssl.key/server.key;
include /usr/local/directadmin/data/users/mojo/nginx_php.conf;
include /etc/nginx/webapps.ssl.conf;
}
server
{
listen 37.97.132.134:80;
server_name ticketsenconcertkaarten.nl www.ticketsenconcertkaarten.nl ;
access_log /var/log/nginx/domains/ticketsenconcertkaarten.nl.log;
access_log /var/log/nginx/domains/ticketsenconcertkaarten.nl.bytes bytes;
error_log /var/log/nginx/domains/ticketsenconcertkaarten.nl.error.log;
root /home/mojo/domains/ticketsenconcertkaarten.nl/public_html;
index index.php index.html index.htm;
include /usr/local/directadmin/data/users/mojo/nginx_php.conf;
location /
{
rewrite ^/.*$ http://weetwaarjekoopt.nl permanent;
}
include /etc/nginx/webapps.conf;
location /
{
rewrite ^.*/files/(.*)$ /wp-includes/ms-files.php?file=$1 last;
if (!-e $request_filename) {
rewrite ^(.+)$ /index.php?q=$1 last;
}
}
}
To be honest I have no clue what I am doing or how I can fix this. Can someone please help me?