Answer the question
In order to leave comments, you need to log in
Why doesn't Nginx start automatically?
I work in Ubuntu. Nginx refuses to start automatically because of one config. But it starts manually and it never swears at this config.
That's what the console says
And here is the config itself
upstream backend_hosts {
server grand-study.com;
}
server {
listen 80;
listen [::]:80;
root /projects/grandstudy.cc/public;
index index.php index.html index.htm index.nginx-debian.html;
server_name grandstudy.cc;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location /storage/ {
proxy_cache imgcache;
proxy_pass http://backend_hosts;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
}
location ~ /\.ht {
deny all;
}
}
Answer the question
In order to leave comments, you need to log in
The reason is this line:server grand-study.com;
nginx resolves hosts at configuration phase, because for a long time
nginx has no non-blocikng resolver. Currently it has, but resolves
hosts at run-time only if proxy_pass contains variables in any place,
not necessarily in the host part.
--
Igor Sysoev
sysoev.ru/en
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question