<div dir="ltr">this module can help you !<div>HttpUpstreamJdomainModule, <a href="http://wiki.nginx.org/HttpUpstreamJdomainModule">http://wiki.nginx.org/HttpUpstreamJdomainModule</a>.</div><div style><br></div><div style>It buffers the latest IPs of the host,even local dns server down, nginx will work well.</div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Aug 19, 2014 at 1:43 PM, ywsample <span dir="ltr"><<a href="mailto:ywsample@gmail.com" target="_blank">ywsample@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><span style="font-family:arial,helvetica,sans-serif">http {<br></span></div><span style="font-family:arial,helvetica,sans-serif">    resolver 127.0.0.1;<br>
</span></div><span style="font-family:arial,helvetica,sans-serif">    resolver_timeout 1s;<br>
</span></div><div><span style="font-family:arial,helvetica,sans-serif">    server {    <br></span></div><div><span style="font-family:arial,helvetica,sans-serif">        listen 8000;<br></span></div><div><span style="font-family:arial,helvetica,sans-serif">        location /test {    <br>

</span></div><div><span style="font-family:arial,helvetica,sans-serif">            proxy_pass http://$arg_host:8080;<br></span></div><div><span style="font-family:arial,helvetica,sans-serif">        }<br>    }<br></span></div>

<div><span style="font-family:arial,helvetica,sans-serif">    server {<br></span></div><div><span style="font-family:arial,helvetica,sans-serif">        listen 8080;<br>        .......<br>    }<br></span></div><div><div>
<div>
<span style="font-family:arial,helvetica,sans-serif">}<br></span><div><span style="font-family:arial,helvetica,sans-serif">ps: other configure is normal<br><br>I have recently discoverd that when DNS server down, the first proxy request return 504 and than the follow proxy request may hang forever.<br>

</span></div><div><div><div><div style="display:inline-block"><div><span></span></div></div></div></div>   <div><div dir="ltr" style="zoom:1">
<span lang="en"><span>I use</span> <span>two</span> <span>curl</span> <span>simulate concurrent</span> <span>requests<br><br></span></span></div></div>
</div><div><span style="font-family:arial,helvetica,sans-serif">I found than the first request timeout in 1 second and exit, also it delete the timeout timer. because another request waiting dns response, so nginx retry send dns query, but dns never response(because it down), it lead to the follow request hang and also no timer relate to it;<br clear="all">

</span></div><div><div><span style="font-family:arial,helvetica,sans-serif"><br>PS:base on nginx-1.7.4<br>-- <br></span><div dir="ltr"><div><span style="font-family:arial,helvetica,sans-serif">ywsample :)<br></span></div>

<div><div><span style="font-family:arial,helvetica,sans-serif"><br></span></div></div></div>
</div></div></div></div></div></div>
<br>_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx</a><br></blockquote></div><br></div>