0
votes

I have following nginx configuration for my reverse proxy load balancer.

upstream appserver{
    server 192.168.1.101:3800;
    server 192.168.1.102:3800;
    server 192.168.1.103:3800;
    server 192.168.1.104:3800;
}
server {
    location /api {
        proxy_pass         http://appserver;
    }
}

If by any chance or error my one node instance is breaking or getting restart in middle of processing request, my load balancer is redirecting the request to other ip in reverse proxy. I dont want this to happen. I want it should not redirect and respond back with 500 or something else.

1

1 Answers

2
votes

If I understand your request correctly I think you need proxy_next_upstream off;

http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_next_upstream