【问题标题】:nginx + proxy pas - 504 gateway timeout , timeout after 1min, 30 sec. Tried proxy_read_timeout but no lucknginx + proxy pas - 504 网关超时,1 分 30 秒后超时。尝试了 proxy_read_timeout 但没有运气
【发布时间】:2012-09-28 10:45:17
【问题描述】:

这是我的配置:

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

但是,我在 1min 30 seconds 后收到 504 Gateway Timeout 错误。但是按照我上面的配置不行,是什么原因? 我怎样才能让它工作更多秒。

【问题讨论】:

标签: php django nginx webserver


【解决方案1】:

我知道 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;
    }
}

【讨论】:

    【解决方案2】:

    如果在您的 NGINX 实例和目标 (proxy_pass) 之间有一个 NAT 网关,this answer 可能会有所帮助。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-01-02
      • 2011-08-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-11-18
      • 2013-02-13
      • 2011-04-08
      相关资源
      最近更新 更多