› NGINX
› NGINX Trac
› 3rd Party Modules
› Security Advisories
› CHANGES
› OpenResty
› ngx_lua
› Tengine
在线学习资源
› NGINX 开发从入门到精通
NGINX Modules
› ngx_echo
ghy459
0D
V2EX  ›  NGINX

用 nginx 反代一个域名,域名 dns 变更后 nginx 返回 504

  •  
  •   ghy459 ·
    ghy459 · Apr 6, 2015 · 4692 views
    This topic created in 4214 days ago, the information mentioned may be changed or developed.
    用域名 www.abc.com 反代 www.abcd.com
    server {

    listen 80;
    server_name www.abc.com;
    location / {
    proxy_pass http://www.abcd.com/;
    }
    }
    当 www.abcd.com 的dns解析更换了新IP之后,访问 www.abc.com 会返回504错误。
    查看nginx log看到 www.abcd.com 仍然解析为旧IP。在server上的dns缓存已经新IP,但nginx获取到的仍然是旧IP。这时只有 reload or restart nginx,才会更新dns信息,访问正常。
    请问nginx有没有能够实时更新被反代域名的dns信息?
    2 replies  •  2015-04-06 19:23:25 +08:00
    ryd994
        2
    ryd994  
       Apr 6, 2015 via Android
    @liuhaotian 不对
    是Nginx upsteam的问题
    http://nginx.org/en/docs/http/ngx_http_upstream_module.html#server
    除非商业版加resolve,DNS解析是在读取配置时完成的,不会跟踪。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   5958 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 03:34 · PVG 11:34 · LAX 20:34 · JFK 23:34
    ♥ Do have faith in what you're doing.