"invalid parameter" on upstream servers (0.6.32)

Maxim Dounin mdounin at mdounin.ru
Fri Nov 7 18:30:55 MSK 2008


Hello!

On Fri, Nov 07, 2008 at 03:37:59PM +0100, Sudara wrote:

> 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

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





More information about the nginx mailing list