Welcome! Log In Create A New Profile

Advanced

max_fails includes read_timeout even if timeout is excluded from proxy_next_upstream

September 22, 2011 07:34AM
Hi,

I am having some trouble with the latest stable of Nginx's proxy upstream support.

I would like Nginx to NOT count read timeouts towards the max_fails in the upstream definition.

Here is what I have:

proxy_cache_path /var/cache/nginx/tptest levels=1:2 keys_zone=tptest:10m;

upstream tptestBackend
{
server tp.dev.infinity.local max_fails=1 fail_timeout=30s;
server dn.dev.infinity.local max_fails=1 fail_timeout=30s;
}

server
{
listen 172.16.0.64:80;
server_name tp.nginx.dev.infinity.local;

proxy_cache tptest;
proxy_set_header Host 'tp.dev.infinity.local';
proxy_set_header X-Real-IP $remote_addr;
proxy_cache_key http://$host$request_uri;
proxy_connect_timeout 1;
proxy_cache_use_stale error timeout updating invalid_header http_500 http_502 http_503 http_504;
proxy_next_upstream error http_500 http_502 http_503 http_504;
proxy_read_timeout 5;

location /
{
proxy_pass http://tptestBackend;
}
}

I have removed "timeout" from the proxy_next_upstream directive, however when I try with a script that sleeps forever, the timeout kicks in, but it does count towards the max_fails, and so next time only the second server is used.

Is this a bug?

Thanks
Subject Author Posted

max_fails includes read_timeout even if timeout is excluded from proxy_next_upstream

tomp September 22, 2011 07:34AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 211
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