简体   繁体   English

nginx错误GET //错误404 HTTP / 1.1“ 499 0”-“”-”

[英]nginx error GET //error-404 HTTP/1.1“ 499 0 ”-“ ”-"

I have some websites hosted on the same server and only for 1 of them, I get a strange issue. 我有一些网站托管在同一台服务器上,但只有其中1个,我遇到了一个奇怪的问题。

When I start nginx the website is reacheable and few hours after, when I try to connect again, the response time is very very slow and I get error on nginx access log file. 当我启动nginx时,网站可访问,数小时后,当我尝试再次连接时,响应时间非常慢,并且在nginx访问日志文件上出现错误。

If I restart nginx or php-fpm (I use unix socket) then works fine..and few hours after the same problem. 如果我重新启动nginx或php-fpm(我使用unix套接字),则工作正常..并且在出现相同问题后数小时。

here is /var/run/php/php7.2-fpm-my_website.sock conf : 这是/var/run/php/php7.2-fpm-my_website.sock conf:

user = my_website
group = my_website
listen = /var/run/php/php7.2-fpm-my_website.sock
listen.owner = www-data
listen.group = www-data
php_admin_value[disable_functions] = exec,passthru,shell_exec,system
pm = dynamic
pm.max_children = 5
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3

I have found some infos here Nginx 499 error codes but I'm not sure :-/ 我在这里找到了一些信息Nginx 499错误代码,但是我不确定:-/

Do you have an idea why? 你知道为什么吗?

Nginx logs are below : Nginx日志如下:

server_ip_address - - [30/Oct/2018:17:24:59 +0000] "GET //erreur-404 HTTP/1.1" 499 0 "-" "-" server_ip_address - - [30/Oct/2018:17:24:59 +0000] "GET //erreur-404 HTTP/1.1" 499 0 "-" "-" server_ip_address - - [30/Oct/2018:17:24:59 +0000] "GET //erreur-404 HTTP/1.1" 499 0 "-" "-" server_ip_address - - [30/Oct/2018:17:26:56 +0000] "GET //erreur-404 HTTP/1.1" 499 0 "-" "-" server_ip_address - - [30/Oct/2018:17:26:58 +0000] "GET //erreur-404 HTTP/1.1" 499 0 "-" "-" server_ip_address - - [30/Oct/2018:17:26:59 +0000] "GET //erreur-404 HTTP/1.1" 499 0 "-" "-" server_ip_address - - [30/Oct/2018:17:26:59 +0000] "GET //erreur-404 HTTP/1.1" 499 0 "-" "-" server_ip_address - - [30/Oct/2018:17:26:59 +0000] "GET //erreur-404 HTTP/1.1" 499 0 "-" "-" client_ip_address - - [30/Oct/2018:17:26:59 +0000] "GET /index.php HTTP/2.0" 200 7330 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36" server_ip_address - - [30/Oct/2018:17:28:57 +000 server_ip_address--[30 / Oct / 2018:17:24:59 +0000]“ GET // erreur-404 HTTP / 1.1” 499 0“-”“-” server_ip_address--[30 / Oct / 2018:17:24 :59 +0000]“ GET // erreur-404 HTTP / 1.1” 499 0“-”“-” server_ip_address--[30 / Oct / 2018:17:24:59 +0000]“ GET // erreur-404 HTTP /1.1“ 499 0”-“”-“ server_ip_address--[30 / Oct / 2018:17:26:56 +0000]” GET // erreur-404 HTTP / 1.1“ 499 0”-“”-“ server_ip_address- -[30 / Oct / 2018:17:26:58 +0000]“ GET // erreur-404 HTTP / 1.1” 499 0“-”“-” server_ip_address--[[30 / Oct / 2018:17:26:59 +0000]“ GET // erreur-404 HTTP / 1.1” 499 0“-”“-” server_ip_address--[30 / Oct / 2018:17:26:59 +0000]“ GET // erreur-404 HTTP / 1.1 “ 499 0”-“”-“ server_ip_address--[30 / Oct / 2018:17:26:59 +0000]” GET // erreur-404 HTTP / 1.1“ 499 0”-“”-“ client_ip_address --[ 30 / Oct / 2018:17:26:59 +0000]“ GET /index.php HTTP / 2.0” 200 7330“-”“ Mozilla / 5.0(Windows NT 10.0; Win64; x64)AppleWebKit / 537.36(KHTML,like Gecko )Chrome / 69.0.3497.100 Safari / 537.36“ server_ip_address--[30 / Oct / 2018:17:28:57 +000 0] "GET //erreur-404 HTTP/1.1" 499 0 "-" "-" server_ip_address - - [30/Oct/2018:17:28:58 +0000] "GET //erreur-404 HTTP/1.1" 499 0 "-" "-" server_ip_address - - [30/Oct/2018:17:28:59 +0000] "GET //erreur-404 HTTP/1.1" 499 0 "-" "-" server_ip_address - - [30/Oct/2018:17:28:59 +0000] "GET //erreur-404 HTTP/1.1" 499 0 "-" "-" client_ip_address - - [30/Oct/2018:17:28:59 +0000] "GET /index.php HTTP/2.0" 200 7330 "-" "Mozilla/5.0 (Windows NT 10.0; 0]“ GET // erreur-404 HTTP / 1.1” 499 0“-”“-” server_ip_address--[30 / Oct / 2018:17:28:58 +0000]“ GET // erreur-404 HTTP / 1.1” 499 0“-”“-” server_ip_address--[30 / Oct / 2018:17:28:59 +0000]“ GET // erreur-404 HTTP / 1.1” 499 0“-”“-” server_ip_address--[30 / Oct / 2018:17:28:59 +0000]“ GET // erreur-404 HTTP / 1.1” 499 0“-”“-” client_ip_address --[30 / Oct / 2018:17:28:59 +0000] “ GET /index.php HTTP / 2.0” 200 7330“-”“ Mozilla / 5.0(Windows NT 10.0; Win64; Win64平台; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36" server_ip_address - - [30/Oct/2018:17:28:59 +0000] "GET //erreur-404 HTTP/1.1" 499 0 "-" "-" x64)AppleWebKit / 537.36(KHTML,例如Gecko)Chrome / 69.0.3497.100 Safari / 537.36“ server_ip_address--[30 / Oct / 2018:17:28:59 +0000]” GET // erreur-404 HTTP / 1.1“ 499 0“-”“-”

website working conf below : 网站工作会议如下:

server {
    listen 80;
    listen [::]:80;
    server_name website_ok.com;
    return 301 https://www.$host$request_uri;
}

server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    server_name www.website_ok.com website_ok.com;
    root /home/website_ok/www/;
    index index.html index.htm index.php;

    access_log /var/log/nginx/website_ok.access_log;
    error_log /var/log/nginx/website_ok.error_log info;

    location ~ \.php$ {
            fastcgi_pass unix:/var/run/php/php7.2-fpm-website_ok.sock;
            fastcgi_index index.php;
            include /etc/nginx/fastcgi_params;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    }

    include /etc/nginx/conf/website_ok.conf;

    location ^~ /administrator {
            auth_basic "Authentification Requise";
            auth_basic_user_file /home/website_ok/www/administrator/.htpasswd;
    }

    include /etc/nginx/conf/joomla.conf;

    ssl_certificate /etc/letsencrypt/live/website_ok.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/website_ok.com/privkey.pem;
    ssl_trusted_certificate /etc/letsencrypt/live/website_ok.com/chain.pem;

    include /etc/nginx/conf/ssl.conf;
}

website NON working conf below : 网站NON working conf如下:

server {
    listen 80;
    listen [::]:80;
    server_name website_error.com;
    return 301 https://www.$host$request_uri;
}

server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    server_name www.website_error.com website_error.com;
    root /home/website_error/www/;
    index index.html index.htm index.php;

    access_log /var/log/nginx/website_error.access_log;
    error_log /var/log/nginx/website_error.error_log info;

    location ~ \.php$ {
            fastcgi_pass unix:/var/run/php/php7.2-fpm-website_error.sock;
            fastcgi_index index.php;
            include /etc/nginx/fastcgi_params;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    }

    include /etc/nginx/conf/website_error.conf;

    location ^~ /administrator {
            auth_basic "Authentification Requise";
            auth_basic_user_file /home/website_error/www/administrator/.htpasswd;
    }

    include /etc/nginx/conf/joomla.conf;

    ssl_certificate /etc/letsencrypt/live/website_error.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/website_error.com/privkey.pem;
    ssl_trusted_certificate /etc/letsencrypt/live/website_error.com/chain.pem;

    include /etc/nginx/conf/ssl.conf;
}

Thanks for your help L. 感谢您的帮助L.

problem solved. 问题解决了。 I have completely re-built website and works fine...seems to be a bad/wrong php script at the origin of this issue. 我已经完全重建了网站,并且工作正常……似乎是此问题起源的错误/错误的php脚本。

thanks 谢谢

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM