ignore "connection: close" from upstream
gfrankliu at gmail.com
Mon Sep 14 20:48:45 UTC 2015
I have below setup:
client -> nginx server A -> proxy server -> real backend server (say,
nginx server B)
I'd like to have the keepalive connection between nginx server A and proxy
server never die. The problem is sometimes the real backend server sends a
"Connection: close". For example, I know if nginx is used as the real
backend server, it will by default send "Connection: close" after 100
requests. When proxy server passes that response to nginx A, nginx will
drop the keepalive link.
Since I don't have control over the real backend server, my question is
whether it is possible to configure nginx A to ignore the upstream
"connection: close" and keep the link alive? Does nginx A have to pass the
"Connection: close" to client? I thought nginx and client manage the
keepalive separately instead of relying on upstream keepalive.
I have control over the proxy server, so I could add a "X-My-Connection:
close" or "X-My-Connection: keep-alive" to manage the connections between
nginx server A and proxy server. Can nginx be configured to honor the
customer header so that we don't be affected by the real backend server?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the nginx