Forum: NGINX "invalid parameter" on upstream servers (0.6.32)

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Sudara (Guest)
on 2008-11-07 16:48
(Received via mailing list)
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 D. (Guest)
on 2008-11-07 17:38
(Received via mailing list)
Hello!

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

> }
> 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 D.
This topic is locked and can not be replied to.