标签: 504

在 nginx 上模拟 502 & 504

有没有办法模拟这些错误?我为它创建了一些自定义文件,但我想确保它们显示正确。我为每个虚拟主机发送了不同的消息。

先感谢您。

http nginx 502 504

7
推荐指数
1
解决办法
1万
查看次数

如何增加 FastCGI 读取超时以防止 nginx 出现 504 错误?

我正在运行一个包含大量编码的文件。处理 500 个用户大约需要 55 秒,但现在我必须处理 1000 个用户。默认超时是 60 秒,所以我必须增加 FastCGI 读取超时。

在 StackOverflow 上发现了这个问题,说我必须增加,fastcgi_read_timeout但我不知道把它放在哪里fastcgi.conf

nginx timeout gateway fastcgi 504

7
推荐指数
1
解决办法
4万
查看次数

HAProxy 特定 URI

所以我的HAProxy配置和这个类似。

listen webaustin 0.0.0.0:80
    mode http
    timeout connect 12000
    timeout server 60000
    timeout queue 120000
    balance roundrobin
    option httpchk GET /index.html
    log global
    option httplog
    option dontlog-normal
    server web1 10.10.10.101:80 maxconn 600 check fall 10
    server web2 10.10.10.102:80 maxconn 600 check fall 10
    server web3 10.10.10.103:80 maxconn 600 check fall 10
    server web4 10.10.10.104:80 maxconn 600 check fall 10
Run Code Online (Sandbox Code Playgroud)

这对我们的系统非常有效,四个后端网络服务器,一个前端网络服务器,超时设置合理。

我的问题是,我有一个 URL,我需要更长的超时时间。这是一项非常繁重的任务,在后端需要很长时间。

无论如何要更改单个 URL 的超时变量?

url timeout haproxy 504

4
推荐指数
1
解决办法
3175
查看次数

HAProxy 间歇性 504 错误

数周以来,我一直在为这个问题而苦苦挣扎,但我的想法已经不多了。我运行 HAProxy 以根据请求的路径/标头在 3 个后端之间代理请求。

我的后端是:

  • 一个 Amazon S3 存储桶
  • 一个 Node.js 应用程序(2 个服务器)
  • 一个名为 prerender.io 的服务

最后一个后端 (prerender.io) 似乎有零问题(尽管它的流量很少)。另外两个随机向客户端返回 504 错误(根据日志大约每分钟一次,但没有明确的模式)。

这是我的(消毒)配置:

defaults
    log     global
    mode    http
    option  httplog
    option  dontlognull
    timeout connect 5s
    timeout client  120s
    timeout server  120s

frontend foobar
    mode http
    bind *:80
    bind *:443 ssl crt /etc/ssl/certs/foobar.com.pem
    redirect scheme https code 301 if !{ ssl_fc }

    default_backend s3

    acl api path_beg -i /api/
    use_backend node if api

    acl user-agent-bot hdr_sub(User-Agent) -i baiduspider twitterbot facebookexternalhit 
    use_backend …
Run Code Online (Sandbox Code Playgroud)

timeout haproxy 504

4
推荐指数
1
解决办法
2万
查看次数

标签 统计

504 ×4

timeout ×3

haproxy ×2

nginx ×2

502 ×1

fastcgi ×1

gateway ×1

http ×1

url ×1