V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
NGINX
NGINX Trac
3rd Party Modules
Security Advisories
CHANGES
OpenResty
ngx_lua
Tengine
在线学习资源
NGINX 开发从入门到精通
NGINX Modules
ngx_echo
mytsing520
V2EX  ›  NGINX

nginx 的 504 问题

  •  
  •   mytsing520 ·
    PRO
    · Jun 5, 2021 · 1239 views
    This topic created in 1794 days ago, the information mentioned may be changed or developed.
    现有的网站架构,nginx-resource,nginx 是长连接( Keep-alive )
    现在,在 nginx 前面再塞一个 nginx,就叫 nginx2 吧,类似 CDN 。。配的也是 keep-alive 。。。即从外到内是 nginx2-nginx-resource 。。
    问题产生,这个时候 CDN 会返回 504 。。
    错误日志里明确显示的是 Connection timed out 。。

    nginx2 和 nginx 之间是国内-国内公网,同运营商,测试没有发现丢包,暂时排除网络原因。。另外,排除防火墙拦截,也排除网络带宽和 nginx2 的资源使用率问题。。。
    在 nginx2 上用 curl 多次测试,除了偶然出现 3 秒返回 response header (概率极低),无法复现连不上的情况。。。

    现在的做法是,将 nginx2 上面关闭了 keep-alive,降低 504 产生数量,但不能解决问题。。。

    有没有大佬有解决思路或排查思路的。。
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2902 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 108ms · UTC 07:17 · PVG 15:17 · LAX 00:17 · JFK 03:17
    ♥ Do have faith in what you're doing.