Nginx 報錯 504 Gateway Time-out 的解決方法
報錯信息
504 Gateway Time-out
原因是程序執(zhí)行時間過長,導致請求超時。
解決方法
首先,盡可能地優(yōu)化程序代碼的執(zhí)行時間。
其次,修改配置文件。
修改 php.ini 配置文件。
max_execution_time = 600修改 nginx.conf 配置文件。
keepalive_timeout 600;
fastcgi_connect_timeout 600;
fastcgi_send_timeout 600;
fastcgi_read_timeout 600;
proxy_connect_timeout 600;
proxy_send_timeout 600;
proxy_read_timeout 600;
send_timeout 600;
重啟 Nginx 和 php-fpm,報錯信息基本上就可以解決。
評論
圖片
表情
