Reverse proxy tuning

B.R. reallfqq-nginx at yahoo.fr
Fri Jun 10 17:34:42 UTC 2016


RTFM:
- upstream <http://nginx.org/en/docs/http/ngx_http_upstream_module.html>
module (specifically the server
<http://nginx.org/en/docs/http/ngx_http_upstream_module.html#server>
directive)
- *_next_upstream & *_*_timeout directives, for each backend communication
module and type of timeout

​The names are so close to your requests I suspect you have not made your
part of the deal <http://www.catb.org/esr/faqs/smart-questions.html>.​
---
*B. R.*

On Fri, Jun 10, 2016 at 10:08 AM, Artur <nginx at netdirect.fr> wrote:

> Hello !
>
> I have a nginx reverse proxy http/https for a node.js application with
> websockets (an extract of the nginx config follows).
>
> I would like to know if there is a way to :
>
> - force nginx to retry connection to the same upstream if there is any
> problem with the initial request to the upstream (timeout,
> reading/writing timeouts, ...)
>
> - do not blacklist an upstream if any error occurs
>
> - do not retry on another upstream
>
> - adjust timeouts on communications between nginx and upstreams
> (connexion, read, write, ...)
>
> I tested some parameters in the 'tests' block below but i'm not sure
> that there is any other paramater I can play with.
>
> http {
>     upstream application {
>         server 127.0.0.1:3030;
>         server 127.0.0.1:3031;
>         server 127.0.0.1:3032;
>     }
> }
>
> server {
>         location /nodejs/application/ {
>                 proxy_pass http://application;
>                 proxy_redirect off;
>
>                 # prevents 502 bad gateway error
>                 proxy_buffers 8 32k;
>                 proxy_buffer_size 64k;
>
>                 # enables WS support
>                 proxy_http_version 1.1;
>                 proxy_set_header Upgrade $http_upgrade;
>                 proxy_set_header Connection $connection_upgrade;
>
>                 # tests
>                 proxy_connect_timeout 75s;
>                 proxy_read_timeout 300s;
>                 proxy_send_timeout 300s;
>                 proxy_next_upstream off;
>        }
> }
>
> Thank you for your feedback.
>
> --
>
> Best regards,
> Artur.
>
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20160610/57070730/attachment.html>


More information about the nginx mailing list