zoukankan      html  css  js  c++  java
  • LNMP下返回500、502、504状态码分析

    1. 500 Internal Server Error

    产生原因:主要是PHP执行脚本过程中产生致命的一些错误。

    nginx error中的记录:

    2. 502 Bad Gateway

    产生原因:fpm挂掉nginx链接不上、fpm不再接受请求(请求打爆)、fpm 执行超时(request_terminate_timeout) 或者 fpm因为某些原因导致拒绝当前request的处理

    nginx error log中的记录:

     此外要注意的是Nginx的upstream模块中的 max_fail 和 fail_timeout 两项。有时Nginx与上游服务器(如FastCGI)的通信只是偶然断掉了,但 max_fail 如果设置的比较小的话,那么在接下来的 fail_timeout时间内,Nginx都会认为上游服务器挂掉了,都会返回502错误。 所以可以将 max_fail 调大一些,将 fail_timeout 调小一些。

    3. 504 Gateway Time-out

    产生原因:fpm的请求处理时间超过了nginx中设置的timeout时间 fastcgi_connect_timeout 、 fastcgi_read_timeout 、fastcgi_send_timeout 这个是nginx是主动响应504

    nginx error log中的记录:

  • 相关阅读:
    MySQL decimal unsigned 更新负数不报错却为0
    centos 安装jdk
    CentOS7安装docker
    Cron 时间元素
    PHPStorm
    日志习惯
    HTTP幂等性
    navicat for mysql 10.1.7注册码
    localStorage、sessionStorages 使用
    FreePascal
  • 原文地址:https://www.cnblogs.com/sanshuiqing/p/14633748.html
Copyright © 2011-2022 走看看