nginx + proxy pas - 504网关超时,超时后1分30秒。试过proxy_read_timeout,但不成功。

问题描述 投票:3回答:1

这是我的配置。

location / {
    proxy_pass http://localhost:8003/;
    proxy_connect_timeout 3600s;
    send_timeout 3600s;
    proxy_read_timeout 3600s;
    include /etc/nginx/proxy_params;
}

但是,我在1分30秒后收到504网关超时错误。但不是根据我上面的配置,是什么原因呢?我怎么能让它工作更多秒。

php django nginx webserver
1个回答
0
投票

我知道OP可能已经离开这个问题很久了,但是超时的设置应该是在 serverhttp 阻止 location 块。例子。

server {
    proxy_connect_timeout 3600s;
    send_timeout 3600s;
    proxy_read_timeout 3600s;

    location / {
        proxy_pass http://localhost:8003/;
        include /etc/nginx/proxy_params;
    }
}


0
投票

IN CASE 在你的NGINX实例&目的地(proxy_pass)之间有一个NAT网关。本回答 可能会有帮助。

© www.soinside.com 2019 - 2024. All rights reserved.