<div dir="ltr"><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)">RTFM:<br></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)">- <a href="http://nginx.org/en/docs/http/ngx_http_upstream_module.html">upstream</a> module (specifically the <a href="http://nginx.org/en/docs/http/ngx_http_upstream_module.html#server">server</a> directive)<br></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)">- *_next_upstream & *_*_timeout directives, for each backend communication module and type of timeout<br></div><div class="gmail_extra"><br><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)">The names are so close to your requests I suspect you have not made <a href="http://www.catb.org/esr/faqs/smart-questions.html">your part of the deal</a>.</div><div><div class="gmail_signature" data-smartmail="gmail_signature"><font size="1"><span style="color:rgb(102,102,102)">---<br></span><b><span style="color:rgb(102,102,102)">B. R.</span></b><span style="color:rgb(102,102,102)"></span></font></div></div>
<br><div class="gmail_quote">On Fri, Jun 10, 2016 at 10:08 AM, Artur <span dir="ltr"><<a href="mailto:nginx@netdirect.fr" target="_blank">nginx@netdirect.fr</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello !<br>
<br>
I have a nginx reverse proxy http/https for a node.js application with<br>
websockets (an extract of the nginx config follows).<br>
<br>
I would like to know if there is a way to :<br>
<br>
- force nginx to retry connection to the same upstream if there is any<br>
problem with the initial request to the upstream (timeout,<br>
reading/writing timeouts, ...)<br>
<br>
- do not blacklist an upstream if any error occurs<br>
<br>
- do not retry on another upstream<br>
<br>
- adjust timeouts on communications between nginx and upstreams<br>
(connexion, read, write, ...)<br>
<br>
I tested some parameters in the 'tests' block below but i'm not sure<br>
that there is any other paramater I can play with.<br>
<br>
http {<br>
upstream application {<br>
server <a href="http://127.0.0.1:3030" rel="noreferrer" target="_blank">127.0.0.1:3030</a>;<br>
server <a href="http://127.0.0.1:3031" rel="noreferrer" target="_blank">127.0.0.1:3031</a>;<br>
server <a href="http://127.0.0.1:3032" rel="noreferrer" target="_blank">127.0.0.1:3032</a>;<br>
}<br>
}<br>
<br>
server {<br>
location /nodejs/application/ {<br>
proxy_pass <a href="http://application" rel="noreferrer" target="_blank">http://application</a>;<br>
proxy_redirect off;<br>
<br>
# prevents 502 bad gateway error<br>
proxy_buffers 8 32k;<br>
proxy_buffer_size 64k;<br>
<br>
# enables WS support<br>
proxy_http_version 1.1;<br>
proxy_set_header Upgrade $http_upgrade;<br>
proxy_set_header Connection $connection_upgrade;<br>
<br>
# tests<br>
proxy_connect_timeout 75s;<br>
proxy_read_timeout 300s;<br>
proxy_send_timeout 300s;<br>
proxy_next_upstream off;<br>
}<br>
}<br>
<br>
Thank you for your feedback.<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
<br>
Best regards,<br>
Artur.<br>
<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" rel="noreferrer" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx</a><br>
</font></span></blockquote></div><br></div></div>