有没有办法让错误504网关超时的时间更长? 如果有,如何更改以及在哪里可以找到要更改的文件。 我正在使用CentOS 6上的nginx。
根据您拥有的网关类型,您应该使用类似以下内容的东西:
proxy_read_timeout 600s;
请查看文档:http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_read_timeout
proxy_read_timeout 60s;
- David Linfastcgi
超时错误,则需要增加 fastcgi_read_timeout
。# /etc/nginx/conf.d/example.com.conf
server {
location ~ \.(php)$ {
fastcgi_pass unix:/var/run/php74-example.com.sock;
fastcgi_read_timeout 300s;
错误日志)上游超时
# tail -f example.com.error.log
2020/12/29 14:51:42 [error] 30922#30922:
*9494 upstream timed out (110: Connection timed out) while reading response header from upstream,
...
upstream: "fastcgi://unix:/var/run/php74-example.com.sock",
...
nginx手册
Default: fastcgi_read_timeout 60s;
Context: http, server, location
http://nginx.org/en/docs/http/ngx_http_fastcgi_module.html#fastcgi_read_timeout
在Chrome DevTools中运行超过60秒的脚本的结果。
默认为60秒。
fastcgi_read_timeout 300秒
timeout server 3000s
。 - fungusanthrax