<div dir="ltr"><div><br></div>Look into  <strong style="color:rgb(0,0,0);font-family:monospace;font-size:medium;text-align:left;background-color:rgb(242,242,242);text-decoration-style:initial;text-decoration-color:initial">proxy_read_timeout</strong><span style="color:rgb(0,0,0);font-family:monospace;font-size:medium;text-align:left;background-color:rgb(242,242,242);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span> </span></span><code style="color:rgb(0,0,0);font-size:medium;text-align:left;background-color:rgb(242,242,242);text-decoration-style:initial;text-decoration-color:initial"><i>time</i></code><span style="color:rgb(0,0,0);font-family:monospace;font-size:medium;text-align:left;background-color:rgb(242,242,242);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">;</span><div><span style="color:rgb(0,0,0);font-family:monospace;font-size:medium;text-align:left;background-color:rgb(242,242,242);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></div><div><span style="text-align:left;background-color:rgb(242,242,242);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><font color="#000000" face="monospace" size="3"><a href="https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_read_timeout">https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_read_timeout</a></font><br></span></div><div><span style="text-align:left;background-color:rgb(242,242,242);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><font color="#000000" face="monospace" size="3"><br></font></span></div><div><span style="text-align:left;background-color:rgb(242,242,242);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><font color="#000000" face="monospace" size="3"><strong style="font-size:medium;background-color:rgb(242,242,242);text-decoration-style:initial;text-decoration-color:initial">proxy_connect_timeout</strong><span style="font-size:medium;background-color:rgb(242,242,242);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span> </span></span><code style="font-size:medium;background-color:rgb(242,242,242);text-decoration-style:initial;text-decoration-color:initial"><i>time</i></code><span style="font-size:medium;background-color:rgb(242,242,242);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">;</span><br></font></span></div><div><span style="text-align:left;background-color:rgb(242,242,242);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><font color="#000000" face="monospace" size="3"><span style="font-size:medium;background-color:rgb(242,242,242);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></font></span></div><div><span style="text-align:left;background-color:rgb(242,242,242);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><font color="#000000" face="monospace" size="3"><span style="background-color:rgb(242,242,242);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><a href="https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_connect_timeout">https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_connect_timeout</a><br></span></font></span></div><br><div class="gmail_quote"><div dir="ltr">On Wed, Jun 27, 2018 at 1:57 PM duda <<a href="mailto:nginx-forum@forum.nginx.org">nginx-forum@forum.nginx.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi<br>
<br>
I have one backend:<br>
<br>
upstream backend_1 {<br>
      server <a href="http://127.0.0.1:35510" rel="noreferrer" target="_blank">127.0.0.1:35510</a>;<br>
}<br>
<br>
and server:<br>
<br>
server {<br>
  ...<br>
  location / {<br>
        proxy_pass <a href="http://backend_1" rel="noreferrer" target="_blank">http://backend_1</a>;<br>
  }<br>
}<br>
<br>
<br>
Sometimes I have to restart my backend and it is unavailable for 3-5sec<br>
(port unreachable)<br>
<br>
How I can tell nginx to "wait" for backend and do not respond with 502 ?<br>
So it should hold connection for 5 second and if it is unreachable in that<br>
interval responds 502 to client.<br>
<br>
Thanks<br>
<br>
Posted at Nginx Forum: <a href="https://forum.nginx.org/read.php?2,280293,280293#msg-280293" rel="noreferrer" target="_blank">https://forum.nginx.org/read.php?2,280293,280293#msg-280293</a><br>
<br>
_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org" target="_blank">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" rel="noreferrer" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Syed Atif Ali<br>Desk: 971 4 4493131</div></div></div>