My problem is that i have several primary servers like:
192.168.0.100/service
192.168.0.101/service
and one backup server like:
192.168.0.102/serviceInternal
Nginx is listening on:
192.168.0.200:8000
Config file looks like:
upstream sth {
server 192.168.0.100:8001; #primary server
server 192.168.0.101:8001; #primary server
server 192.168.0.102:8001 backup; #backup server
}
server {
listen 192.168.0.200:8000;
location /service {
if ( primary_servers = up ) {
proxy_pass sth/service;
}
if ( primary_servers = down ) {
proxy_pass sth/serviceInternal;
}
}
}
I hope i presented my problem in quite clear way :)
/service(not/serviceInternal) then simpleproxy_pass http://sth/service;would do what you want.