server persistance using sticky cookie

mondji nginx-forum at
Wed Feb 24 02:54:00 UTC 2021

I have setup this module to
have an upstream server persistance using cookies, 
I compiled nginx 1.18.0 with this module suscessfully.

Here is my loadbalancer configuration:


proxy_cache_path /path/to_cache/dir keys_zone=backcache:10m;

upstream backendServers {
  server IP1:81;
  server IP2:81;
sticky name=mysticky expire=10860 path=/;

server {
    listen IP3:80;
        location / {
        return 301 https://$server_name$request_uri;

server {
    listen IP3:443 ssl;
    location / {
        proxy_pass https://backendServers;  
        proxy_http_version 1.1;  
        proxy_set_header Upgrade $http_upgrade;  
        proxy_set_header Connection $connection_upgrade; 

backend servers are running iis linked with coldfusion (tomcat).
The sticky seems not working: when I stop a web site on server 1, nginx
continue to send requests to that
server. The loadbalance occures only when I clear the browser cache, or
reboot server 1.
The cookie is set (name, expiration,...) but nginx is "sticked" to the down

Is someone here who has tested thi s module
with recente nginx version
If yes, is it working ? ciuld you share your experience ?


Posted at Nginx Forum:,290835,290835#msg-290835

More information about the nginx mailing list