K
K
Konstantin B.2019-06-13 15:54:59
Nginx
Konstantin B., 2019-06-13 15:54:59

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
5d02477edfe53628053416.png
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

1 answer(s)
A
Andrew, 2019-06-13
@deepblack

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

https://forum.nginx.org/read.php?2,84712,84796#msg...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question