Nginx reverse proxy for Jersey SSE, CLOSE_WAIT connections eventually choke server -
i have java webapp uses jersey sse, when directly connect tomcat instance, no: of close_wait connections not grow.(verified curl)
when go through nginx reverse proxy, connections related sse call keep growing (in close_wait) , server process chokes, , needs restart. given below config, guessing nginx closes connection every 60s , creates new 1 next sse request, ideas how fix ?
upstream tomcat {     server 192.168.10.101:8443;     server 192.168.10.102:8443;     keepalive 16; } server { listen       443 ssl; #server_name  192.168.10.100; server_name myserver.home.net;  ssl_certificate      /opt/mount/config/certs/test_ssl.pem; ssl_certificate_key  /opt/mount/config/certs/test_ssl_cert.key;  ssl_session_cache shared:ssl:1m; ssl_session_timeout  5m;  ssl_ciphers rc4:high:!anull:!md5; ssl_prefer_server_ciphers on; keepalive_timeout 180s;   location / {     proxy_pass             https://tomcat/mydashboard/;     proxy_set_header       x-real-ip $remote_addr;     proxy_set_header       x-forwarded-for $proxy_add_x_forwarded_for;     proxy_set_header       host $http_host;     proxy_redirect off;     proxy_http_version 1.1;     proxy_set_header connection "";     chunked_transfer_encoding off;     proxy_cookie_domain     ~(.*)$  ws1.home.net;     rewrite ^/dashboard/(.*)$ /$1 last;  }   }
for stuck issue add following location section.
 proxy_read_timeout 7200;      
Thank you for sharing this post.
ReplyDeleteDevOps Training
DevOps Online Training