Page 1 of 2

[БАГ] Error: can't parse config /home/admin/conf/web/nginx.conf

Posted: Tue Oct 18, 2016 1:01 am
by zar0ku1
Здравствуйте,

пришлось слегка изменить конфиг nginx, для правильного рерайта скриптов, и сразу отвалился бэкап
причем nginx работает нормально, сайт работает тоже нормально

Code: Select all

nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
а вот в логах бэкапа мы видим следющее

Code: Select all

-- WEB --
2016-10-18 00:55:01 services.astv.ru
Error: can't parse config /home/admin/conf/web/nginx.conf
-- SYSTEM --
2016-10-18 01:00:01 admin.conf
2016-10-18 01:00:01 stats.log
2016-10-18 01:00:01 history.log
2016-10-18 01:00:01 pam
что делать? нашел похожий баг аж от 1 июля
https://github.com/serghey-rodin/vesta/issues/723 когда планируется фикс?

Re: [БАГ] Error: can't parse config /home/admin/conf/web/nginx.conf

Posted: Tue Oct 18, 2016 6:34 am
by skurudo
Можете показать ваш конфиг, который не парсится?

Re: [БАГ] Error: can't parse config /home/admin/conf/web/nginx.conf

Posted: Tue Oct 18, 2016 8:05 am
by zar0ku1
skurudo wrote:Можете показать ваш конфиг, который не парсится?

Code: Select all

server {
    listen      [ip]:80;
    server_name [domain];
    root        /home/[user]/web/[domain]/public_html;
    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;

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

    location = /robots.txt {
        allow all;
        log_not_found off;
        access_log off;
    }

    location ~* \.(txt|log)$ {
        allow [local-ip]/16;
        deny all;
    }

    location ~ \..*/.*\.php$ {
        return 403;
    }

    location ~ ^/sites/.*/private/ {
        return 403;
    }

    location ~ (^|/)\. {
        return 403;
    }

    location / {
        try_files $uri /index.php?$query_string; # For Drupal >= 7
    }

    location @rewrite {
        rewrite ^/(.*)$ /index.php?q=$1;
    }

    location ~ /vendor/.*\.php$ {
        deny all;
        return 404;
    }

    location ~ '\.php$|^/update.php' {
        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
        include fastcgi_params;
        fastcgi_param HTTP_PROXY "";
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param PATH_INFO $fastcgi_path_info;
        fastcgi_intercept_errors on;
        fastcgi_pass [ip:port];
    }

    location ~ ^/sites/.*/files/styles/ { # For Drupal >= 7
        try_files $uri @rewrite;
    }

    location ~ ^/system/files/ { # For Drupal >= 7
        try_files $uri /index.php?$query_string;
    }

    location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
        expires max;
        log_not_found off;
    }
}

Re: [БАГ] Error: can't parse config /home/admin/conf/web/nginx.conf

Posted: Wed Oct 19, 2016 11:02 am
by zar0ku1
Есть идеи?

Re: [БАГ] Error: can't parse config /home/admin/conf/web/nginx.conf

Posted: Wed Oct 19, 2016 5:56 pm
by Serjies
А что в консоли пишет по команде nginx -t ? Видно же где ошибка должно быть..

Re: [БАГ] Error: can't parse config /home/admin/conf/web/nginx.conf

Posted: Sun Oct 23, 2016 12:29 am
by zar0ku1
Serjies wrote:А что в консоли пишет по команде nginx -t ? Видно же где ошибка должно быть..
прочитайте самое первое сообщение

Code: Select all

nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

Re: [БАГ] Error: can't parse config /home/admin/conf/web/nginx.conf

Posted: Mon Oct 31, 2016 12:44 am
by zar0ku1
Есть идеи почему так происходит?

Re: [БАГ] Error: can't parse config /home/admin/conf/web/nginx.conf

Posted: Sat Nov 12, 2016 10:07 pm
by Vladzimir
Появился аналогичный баг. Нгинкс конфиг валидирует.

Re: [БАГ] Error: can't parse config /home/admin/conf/web/nginx.conf

Posted: Sun Nov 13, 2016 10:16 am
by zar0ku1
Vladzimir wrote:Появился аналогичный баг. Нгинкс конфиг валидирует.
где-то ошибка в условии проверки конфига видимо, и он думает что конфиг не валидный

Re: [БАГ] Error: can't parse config /home/admin/conf/web/nginx.conf

Posted: Sun Nov 13, 2016 10:41 am
by imperio