[英]Can't increase timeout on nginx with php-fpm
我的 Nginx 拒絕從默認的 60 秒增加請求的超時時間。
我已經設置了以下參數,但服務器在 60 秒后仍然給我 504:
fastcgi_connect_timeout 300s;
fastcgi_send_timeout 300s;
fastcgi_read_timeout 300s;
proxy_connect_timeout 300s;
proxy_read_timeout 300s;
client_header_timeout 300s;
client_max_body_size 200m;
client_body_timeout 300s;
send_timeout 300s;
有趣的是,將值設置為 30 秒有效,並且請求在 30 秒后超時。 PHP-fpm 中的 request_terminate_timeout 也設置為 300 秒。
我必須設置哪些參數才能使其超過 60 秒?
您是否在“http”部分的末尾添加了以下指令?
http {
<...>
include /etc/nginx/conf.d/.conf;
proxy_send_timeout 180s;
proxy_read_timeout 180s;
fastcgi_send_timeout 180s;
fastcgi_read_timeout 180s;
}
在此之后,您可能還需要重新啟動 nginx 服務器。
另一個對您沒有任何改變的可能原因是您可能編輯了錯誤的文件,但我對此表示懷疑。 :)
為了驗證路徑, nginx -t
和nginx -V
都會打印出默認的 nginx 配置文件路徑。
來源: http : //nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_read_timeout
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.