I am running 0.8.14 on Ubuntu (compiled from source with openssl).
Desired result is static cache as backup for dynamic asp webapp. Cache
builds nicely, serves fine on 127.0.0.2:80 or unix socket, however when
I attempt to manage weights and also specify that 127.0.0.2:80 is backup
I get:
On Tue, Sep 08, 2009 at 11:05:04AM -0400, stefancaunter wrote:
this is the funny thing, with ip_hash removed from upstream config, I still get
: invalid parameter “backup”
and I’m not sure why. I wonder if anyone sees this behaviour. I can flip to the backup server but it isn’t automatic…
This usually means that you used upstream before definition and
therefore default upstream was implicitly created (assuming you
just used hostname in proxy_pass).
Directive proxy_pass accepts either upstream name as defined
earlier via upstream{} block or backend hostname (or ip, or unix
socket). In the later case it implicitly creates upstream
block with single server inside.
Therefore this will work as expected:
http {
upstream backend {
server 192.168.0.1:80;
server 192.168.0.2:80 backup;
}
server {
...
location / {
proxy_pass http://backend;
}
}
}
And this will fail claiming it can’t use “backup”, as nginx will
interpret “backend” string as hostname that should be resolved via
DNS and will be confused by “upstream backend { … }” that comes
later on: