W
W
WorldDelete .2017-07-27 23:38:59
Nginx
WorldDelete ., 2017-07-27 23:38:59

NGINX stops working after copying file to sites-enabled. How to decide?

In general, good evening.
I decided to mess with nginx'om and apache2 site I smoked the
manual, in the end, I did everything right
But, an error appeared,
[email protected]:~# sudo service nginx restart
* Restarting nginx nginx [fail]
I remove it from the folder - everything restarts fine, why is that , I do not understand.
Naturally here is the config

spoiler
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
root /var/www/russiacraft;
index index.html index.php index.htm;
server_name russiacraft.ru www.russiacraft.ru;
# dasfmksadgsdkfgjgjsdfgsdfgASD - это ваш секретный путь к phpMyadmin, таким образом всё
# что касается phpMyadmin, будет отдавать Apache и страница будет корректно отображаться.
# Картинки и прочее отдаёт Nginx
location ~* ^(?!/sasfdsdgfsdfgsdfg/).+\.(jpg|jpeg|gif|png|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|tar|wav|bmp|rtf|swf|ico|flv|txt|xml|docx|xlsx)$ {
access_log off;
expires 30d;
}
# запрет на доступ к .htaccess
location ~ /\.ht {
deny all;
}
# передача запроса апачу
location / {
proxy_pass localhost:81/; # Порт на котором висит Apache
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-for $remote_addr;
proxy_set_header Host $host;
proxy_connect_timeout 300;
proxy_send_timeout 300;
proxy_read_timeout 300;
proxy_redirect off;
proxy_set_header Connection close;
proxy_pass_header Content-Type;
proxy_pass_header Content-Disposition;
proxy_pass_header Content-Length;
}
}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question