Discussion:
"invalid parameter" on upstream servers (0.6.32)
Sudara
2008-11-07 14:37:59 UTC
Permalink
Hi there!

I would like to set max_fails=x on one of my server upstreams.

This is how it looks:

upstream mongrel_upstream {
server 127.0.0.1:5000;
server 127.0.0.1:5001;
server 127.0.0.1:5002;
}

Whenever I add max_fails=2 (or any other option like fail_timeout=0s)
like so:

upstream mongrel_upstream {
server 127.0.0.1:5000 max_fails=2;
server 127.0.0.1:5001;
server 127.0.0.1:5002;
}

I get the following error:

Invalid parameter "max_fails=2" in /etc/nginx/servers/myserver.conf:3

What is strange is that I've used max_fails before successfully, and
the config here is virtually identical. Everything else works fine in
the upstream, it is only when adding an option like max_fails or
fail_timeout that we have issues.

Any ideas? I'm using nginx 0.6.32

Thanks,
Sudara
Maxim Dounin
2008-11-07 15:30:55 UTC
Permalink
Hello!
Post by Sudara
Hi there!
I would like to set max_fails=x on one of my server upstreams.
upstream mongrel_upstream {
server 127.0.0.1:5000;
server 127.0.0.1:5001;
server 127.0.0.1:5002;
}
Whenever I add max_fails=2 (or any other option like fail_timeout=0s)
upstream mongrel_upstream {
server 127.0.0.1:5000 max_fails=2;
server 127.0.0.1:5001;
server 127.0.0.1:5002;
}
Invalid parameter "max_fails=2" in /etc/nginx/servers/myserver.conf:3
What is strange is that I've used max_fails before successfully, and the
config here is virtually identical. Everything else works fine in the
upstream, it is only when adding an option like max_fails or
fail_timeout that we have issues.
Any ideas? I'm using nginx 0.6.32
Upstreams must be defined *before* use (i.e. before proxy_pass
...), or they are treated as implicitly defined by backend
hostname, and this later results in the error above (since
implicitly defined upstream can't have max_fails).

Error is a bit misleading, probably someone should dig into the
code and fix it do die early with more appropriate message.

Maxim Dounin

Loading...