Welcome! Log In Create A New Profile

Advanced

Removal of server from nginx load balancer does not reflect after nginx reload

August 14, 2015 02:20AM
Hi,
I am using nginx 1.8.0 as a load balancer.

Below is the configuration snippet:

upstream appservers {
least_conn;
server 10.21.3.123:8083;
server 10.21.3.125:8083;
}

server {
listen 443 ssl spdy backlog=2048;
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains";

add_header Alternate-Protocol 443:npn-spdy/3;

ssl_certificate /etc/nginx/click.rummycircle.com/click.rummycircle.com.crt;
ssl_certificate_key /etc/nginx/click.rummycircle.com/click.rummycircle.com.key;

ssl_ciphers ECDHE-RSA-AES256-SHA384:AES256-SHA256:AES256-SHA256:RC4:HIGH:!MD5:!SSLv2:!ADH:!aNULL:!eNULL:!NULL:!DH:!ADH:!EDH:!AESGCM;
ssl_prefer_server_ciphers on;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;

location / {
# log_format postdata '$remote_addr - $remote_user [$time_local] '
# '"$request" $status $bytes_sent '
# '"$http_referer" "$http_user_agent" "$request_body"';
# access_log /home/deploy/nginx_logs/new_access.log postdata;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://appservers;
}
}

Nginx is balancing the load between our 2 servers: 10.21.3.123 and 10.21.3.125. I want to remove one server from the load balancer at runtime without any packet loss. So I removed i by changing the configuration like below:
upstream appservers {
least_conn;
server 10.21.3.123:8083;
}

Then I reloaded nginx: sudo service nginx reload
I checked with nginx -t that Nginx successfully reloaded.
However, it still continues to send new requests to the removed server. Please assist.


My OS details:
uname -a
Linux an-lb-01 2.6.32-504.12.2.el6.x86_64 #1 SMP Wed Mar 11 22:03:14 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
Subject Author Posted

Removal of server from nginx load balancer does not reflect after nginx reload

dhirajpraj@gmail.com August 14, 2015 02:20AM

Re: Removal of server from nginx load balancer does not reflect after nginx reload

ryd994 August 14, 2015 01:28PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 107
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready