<div>in ngx_http_upstream_resolve_handler, posted requests are not handled, so if a run time</div><div>dns resolving is failed in a subrequest, (for example, the resolver can not be reached, or </div><div>the domain does not exist) the main request will know nothing about this, until something</div>
<div>else attached to this connection happens, like connection broken or a write timeout</div><div><br></div><div>a patch is attached and hope it helps</div><div><br></div>simple configuration that can reproduce the problem (with addition module enabled):<div>
<br></div><div><div> addition_types *;</div><div><br></div><div> resolver your_resolver_here;</div><div><br></div><div> location /test {</div><div> set $ihost xxx; # xxx here causes a failed run-time dns resolving</div>
<div> proxy_pass http://$ihost;</div><div> }</div><div><br></div><div> location /zzz {</div><div> add_after_body /test;</div><div> return 200 "test";</div><div> }</div></div><div><br></div><div>
curl -v <a href="http://localhost/zzz">http://localhost/zzz</a></div>