@Kostik_1993
Web Developer

Почему Nginx не запускается автоматически?

Работаю в Ubuntu. Nginx отказывается автоматически стартовать из-за одного конфига. Но в ручную он запускается и на конфиг этот он не ругается ни разу

Вот что говорит консоль
5d02477edfe53628053416.png

А вот сам конфиг
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;
    }
}
  • Вопрос задан
  • 169 просмотров
Пригласить эксперта
Ответы на вопрос 1
deepblack
@deepblack
Причина в этой строке: 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...
Ответ написан
Комментировать
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы