Welcome! Log In Create A New Profile

Advanced

Reverse proxy tuning

Artur
June 10, 2016 04:10AM
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@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Reverse proxy tuning

Artur June 10, 2016 04:10AM

Re: Reverse proxy tuning

B.R. June 10, 2016 01:36PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 106
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready