nginx 出现504 Gateway Time-out 相关设置
nginx配置
nginx.conf中,设置以下几个参数,增加超时时间
fastcgi_connect_timeout
fastcgi连接超时时间,默认60秒
fastcgi_send_timeout
nginx 进程向 fastcgi 进程发送请求过程的超时时间,默认值60秒
fastcgi_read_timeout
fastcgi 进程向 nginx 进程发送输出过程的超时时间,默认值60秒
php配置
php.ini
max_execution_time
php脚本最大执行时间
php-fpm
request_terminate_timeout
设置单个请求的超时时间
php程序中可加入set_time_limit(seconds)设置最长执行时间
nginx 三个代理超时时间配置
proxy_connect_timeout
proxy_send_timeout
proxy_read_timeout
我们先看下nginx官网对他们的解释:
proxy_connect_timeout 60s;
Defines a timeout for establishing a connection with a proxied server. It should be noted that this timeout cannot usually exceed 75
seconds. 定义与被代理服务器建立连接的超时时间。请注意,此超时通常不能超过75秒。
proxy_send_timeout dedault 60s
Sets a timeout for transmitting a request to the proxied server. The timeout is set only between two successive write operations, not for
the transmission of the whole request. If the proxied server does not
receive anything within this time, the connection is closed.
设置将请求传输到被代理服务器的超时时间。只在两个连续的写操作之间设置超时,而不是整个请求的传输。如果代理服务器在这段时间内没有收到数据,连接将被关闭。
proxy_read_timeout default 60s
Defines a timeout for reading a response from the proxied server. The timeout is set only between two successive read operations, not for
the transmission of the whole response. If the proxied server does not
transmit anything within this time, the connection is closed.
定义从被代理服务器读取响应的超时。超时设置仅在两个连续的读取操作之间,而不是整个响应的传输。如果代理服务器在这段时间内没有传输数据,连接将被关闭。
这篇好文章是转载于:学新通技术网
- 版权申明: 本站部分内容来自互联网,仅供学习及演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,请提供相关证据及您的身份证明,我们将在收到邮件后48小时内删除。
- 本站站名: 学新通技术网
- 本文地址: /boutique/detail/tanhfjbeac
-
photoshop保存的图片太大微信发不了怎么办
PHP中文网 06-15 -
《学习通》视频自动暂停处理方法
HelloWorld317 07-05 -
word里面弄一个表格后上面的标题会跑到下面怎么办
PHP中文网 06-20 -
Android 11 保存文件到外部存储,并分享文件
Luke 10-12 -
photoshop扩展功能面板显示灰色怎么办
PHP中文网 06-14 -
微信公众号没有声音提示怎么办
PHP中文网 03-31 -
excel下划线不显示怎么办
PHP中文网 06-23 -
excel打印预览压线压字怎么办
PHP中文网 06-22 -
TikTok加速器哪个好免费的TK加速器推荐
TK小达人 10-01 -
怎样阻止微信小程序自动打开
PHP中文网 06-13