**NGINX LOad Balancing**
Am trying to load balance my servers hosted in IIS using nginx. If i shut down one of the app pool, nginx should stop sending requests to that server. But what I am seeing nginx will keep sending requests to both servers.Below is my configuration.
events {
worker_connections 2048;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile off;
#tcp_nopush on;
keepalive_timeout 0;
upstream xxx {
server xxxxxxx:80 max_fails=1 fail_timeout=30;
server xxxxxxxx:80 max_fails=1 fail_timeout=30;
}
server {
listen zzzz;
server_name localhost;
location /yy {
proxy_cache off;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
proxy_set_header Connection "";
proxy_http_version 1.1;
proxy_pass http://xxx;
}
}
Nginx will still keep sending the requests to the other server even though i have shut down the app pool.
<HTML>
<HEAD>
<TITLE>Service Unavailable</TITLE>
</HEAD>
<BODY>
<h2>Service Unavailable</h2>
<hr>
<p>HTTP Error 503. The service is unavailable.</p>
</BODY>
</HTML>