Page 1 of 1

Лег nginx и не поднимается

Posted: Sat Jun 15, 2019 10:49 am
by Shashel
Здравствуйте, все работало, а потом бах и на ровном месте лег nginx и не поднимается.
Использую ssl, centos, phpfpm+nginx, все работало, никаких изменений на сервере не проводил...

Code: Select all

2019/06/15 13:46:41 [warn] 20540#20540: the "ssl" directive is deprecated, use the "listen ... ssl" directive instead in /home/admin/conf/web/mydomain.ru.nginx.ssl.conf:10
2019/06/15 13:46:41 [emerg] 20540#20540: open() "/home/admin/conf/web/mydomain.ru.auth" failed (2: No such file or directory) in /home/admin/conf/web/mydomain.ru.nginx.ssl.conf:79

Конфиг адаптирован под Wordpress multisite на поддоменах
До сегодняшнего дня все долго работало без проблем

Code: Select all

server {
    listen      %ip%:%web_ssl_port% ssl http2;
    server_name %domain_idn% %alias_idn%;
    root        %docroot%;
    index       index.php index.html index.htm;
    access_log  /var/log/nginx/domains/%domain%.log combined;
    access_log  /var/log/nginx/domains/%domain%.bytes bytes;
    error_log   /var/log/nginx/domains/%domain%.error.log error;

    ssl         on;
    ssl_certificate      %ssl_pem%;
    ssl_certificate_key  %ssl_key%;

	
    location = /favicon.ico {
        log_not_found off;
        access_log off;
    }

location = /robots.txt {
    try_files $uri $uri/ /index.php?$args;
    access_log off;
    log_not_found off;
    }

    location / {
    try_files $uri $uri/ /index.php?$args;

        if (!-e $request_filename)
        {
            rewrite ^(.+)$ /index.php?q=$1 last;
        }

        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
            expires     max;
        }

        location ~ [^/]\.php(/|$) {
       
	    fastcgi_buffers 8 256k;
        fastcgi_buffer_size 128k;
        fastcgi_intercept_errors on;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
		
		fastcgi_cache microcache;
        fastcgi_cache_key $scheme$host$request_uri$request_method;
		fastcgi_cache_valid 200 301 302 30s;
		fastcgi_cache_use_stale updating error timeout invalid_header http_500;
		fastcgi_pass_header Set-Cookie;
		fastcgi_pass_header Cookie;
		fastcgi_ignore_headers Cache-Control Expires Set-Cookie;   

		
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            if (!-f $document_root$fastcgi_script_name) {
                return  404;
            }

            fastcgi_pass    %backend_lsnr%;
            fastcgi_index   index.php;
            include         /etc/nginx/fastcgi_params;
        }
    }
    error_page  403 /error/404.html;
    error_page  404 /error/404.html;
    error_page  500 502 503 504 /error/50x.html;

    location /error/ {
        alias   %home%/%user%/web/%domain%/document_errors/;
    }

    location ~* "/\.(htaccess|htpasswd)$" {
        deny    all;
        return  404;
    }

    location /vstats/ {
        alias   %home%/%user%/web/%domain%/stats/;
        include %home%/%user%/conf/web/%domain%.auth;
    }

    include     /etc/nginx/conf.d/phpmyadmin.inc*;
    include     /etc/nginx/conf.d/phppgadmin.inc*;
    include     /etc/nginx/conf.d/webmail.inc*;

    include     %home%/%user%/conf/web/nginx.%domain_idn%.conf*;

} 

Code: Select all

service nginx restart
Redirecting to /bin/systemctl restart nginx.service
Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -xe" for details.

Re: Лег nginx и не поднимается

Posted: Sat Jun 15, 2019 11:07 am
by grayfolk

Code: Select all

2019/06/15 13:46:41 [emerg] 20540#20540: open() "/home/admin/conf/web/mydomain.ru.auth" failed (2: No such file or directory) in /home/admin/conf/web/mydomain.ru.nginx.ssl.conf:79
Создайте файл /home/admin/conf/web/mydomain.ru.auth

Re: Лег nginx и не поднимается

Posted: Sat Jun 15, 2019 11:15 am
by Shashel
grayfolk wrote:
Sat Jun 15, 2019 11:07 am

Code: Select all

2019/06/15 13:46:41 [emerg] 20540#20540: open() "/home/admin/conf/web/mydomain.ru.auth" failed (2: No such file or directory) in /home/admin/conf/web/mydomain.ru.nginx.ssl.conf:79
Создайте файл /home/admin/conf/web/mydomain.ru.auth
Огроменное спасибо!
Чего-то я не догадался, полез копаться в темплейты и так далее.
Главное все работало, а утром глядь, лежит.... в чем причина не понятно....

Re: Лег nginx и не поднимается

Posted: Thu Jun 27, 2019 1:52 pm
by UserVest
Такая же проблема была.
Я закоментировал #include /home/admin/conf/web/domain.com.auth;
Откуда появился файл .auth? это не взлом wordpress?

Re: Лег nginx и не поднимается

Posted: Thu Jun 27, 2019 2:03 pm
by grayfolk
UserVest wrote:
Thu Jun 27, 2019 1:52 pm
Такая же проблема была.
Я закоментировал #include /home/admin/conf/web/domain.com.auth;
Откуда появился файл .auth? это не взлом wordpress?
Нет, не взлом. Это аутентификация для веб-статистики - webalizer или awstats.

Re: Лег nginx и не поднимается

Posted: Thu Jun 27, 2019 2:38 pm
by UserVest
grayfolk wrote:
Thu Jun 27, 2019 2:03 pm
UserVest wrote:
Thu Jun 27, 2019 1:52 pm
Такая же проблема была.
Я закоментировал #include /home/admin/conf/web/domain.com.auth;
Откуда появился файл .auth? это не взлом wordpress?
Нет, не взлом. Это аутентификация для веб-статистики - webalizer или awstats.
Спасибо.