nginx日志常见报错解决

目录

一:报错

二:php查看后台内容有的栏目出现502?

三:413 Request Entity Too Large?

四:Request Header Or Cookie Too Large  400


一:报错

 upstream prematurely closed connection while reading response header from upstream, client: 114.95.224.97, server: old.dagongchang.com, request: "GET /dgc_adMin/order.php?act=info&order_id=255336 HTTP/1.1", upstream: "http://127.0.0.1:8000/dgc_adMin/order.php?act=info&order_id=255336", host: "old.dagongchang.com", referrer: "http://old.dagongchang.com/dgc_adMin/order.php?act=list

解决:

(1)可能是连接数据库超时,查看数据库日志;

排查:web和数据库一个地方,web和数据库两个地方判断;

常见错误日志:

(一):

 upstream prematurely closed connection while reading response header from upstream, client: 114.95.224.97, server: old.dagongchang.com, request: "GET /dgc_adMin/order.php?act=info&order_id=255336 HTTP/1.1", upstream: "http://127.0.0.1:8000/dgc_adMin/order.php?act=info&order_id=255336", host: "old.dagongchang.com", referrer: "http://old.dagongchang.com/dgc_adMin/order.php?act=list

解决:

(1)可能是连接数据库超时,查看数据库日志;

排查:web和数据库一个地方,web和数据库两个地方判断;

常见错误日志:


nginx日志常见报错解决_第1张图片

二:php查看后台内容有的栏目出现502?

(1)可能是php读取数据库时间太长或者计算量太大,加大php.ini里的内存;

   (2)得到相关的php语句查看打印执行时间;

   (3)去掉相关的sql语句试试.

三:413 Request Entity Too Large?

client_max_body_size 50m;  上传大小限制

四:Request Header Or Cookie Too Large  400

Warning: session_write_close(): Failed to write session data (user). Please verify that the current setting of session.save_path is correct () in Unknown on line 0

解决:发现泛解析错误

# ServerAdmin [email protected]

  DocumentRoot "/www/wwwroot/wp"

  ServerName www.veipifa.com

  ServerAlias *.veipifa.com              这里写错了 写成dagongchang.com了

  LimitRequestBody 524288000

  ErrorLog "/www/weblogs/www.veipifa.com_httpd_error.log"

  CustomLog "/www/weblogs/www.veipifa.com_httpd_access.log" common

# Options Indexes FollowSymLinks

 Options  FollowSymLinks

 AllowOverride All

 Require all granted

 ExpiresByType text/css A5

 ExpiresByType application/x-javascript A5

 ExpiresByType image/gif A5

# Require all denied

 

五:[error] 9706#0: *203994 FastCGI sent in stderr: "PHP message: PHP Notice:  Undefined index: HTTP_X_REAL_IP in /data/wwwroot/apigmtool.youjoy.tv/app/Controller/Api/Controller.php on line 13" while reading response header from upstream, client: 140.207.91.206, server: apigmtool.youjoy.tv, request

php5会出现这个问题 ,解决在变量前面加上@ ,nginx就不会提示这种警告了

你可能感兴趣的:(nginx,nginx,运维)