<div>Hi, Aleks,<br><div><br><div>Actually I read what you mention. The document about "proxy_pass_header" just pass the headers listed in "proxy_hide_header" which do not include "Connection", so I think it might doesn't work. I will try this.<br><div><br><div>BTW, this module ngx_http_upstream_module should be built by default right, because the directive proxy_pass is supported by this module. My output of "nginx -V" doesn't not include this module.<br><div><br><div>Thanks<br><div>Liu Peng<br><br></div></div></div></div></div></div></div></div><div id="origbody"><div style="background: #f2f2f2;">----- 原始邮件 -----<br>发件人:Aleksandar Lazic <al-nginx@none.at><br>收件人:tjlp@sina.com<br>抄送人:nginx <nginx@nginx.org><br>主题:Re:_回复:Re:_回复:Re:_Issue_about_nginx_removing_the_header_"Connection"_in_HTTP_response?<br>日期:2017年03月04日 17点22分<br></div><br><br>Hi Liu Peng.<br>Am 04-03-2017 09:12, schrieb tjlp@sina.com:<br>> <br>> Hi, Alexks,<br>> <br>> I don't want to hide the header.<br>> My problem is that Nginx change the "Connection: close" header in the<br>> reponse from upstream server to "Connction: keep-alive" and send to<br>> client. I want to keep the original "Connection: close" header.<br>Ah that's a clear question.<br>It took us only 3 rounds to get to this clear question ;-)<br>So now the standard Questions from me:<br>What's the output of nginx -V ?<br>What's your config?<br>Maybe you have set 'keepalive' in the upstream config<br>http://nginx.org/en/docs/http/ngx_http_upstream_module.html#keepalive<br>or<br>'proxy_http_version 1.1;'<br>http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_http_version<br>as a last resort you can just pass the header with<br>'proxy_pass_header Connection;'.<br>http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_pass_header<br>Choose the solution which fit's to your demand.<br>I can only guess due to the fact that we don't know your config.<br>May I ask you to take a look into this document, which exists in several<br>languages, thank you very much.<br>http://www.catb.org/~esr/faqs/smart-questions.html<br>Best regards<br>Aleks<br>> Thanks<br>> Liu Peng<br>> <br>> ----- 原始邮件 -----<br>> 发件人:Aleksandar Lazic <al-nginx@none.at><br>> 收件人:tjlp@sina.com<br>> 抄送人:nginx <nginx@nginx.org><br>> 主题:Re:_回复:Re:_Issue_about_nginx_removing_the_header_"Connection"_in_HTTP_response?<br>> 日期:2017年03月03日 16点19分<br>> Hi.<br>> <br>> then one directive upward.<br>> <br>> http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_hide_header<br>> <br>> Cheers<br>> <br>> aleks<br>> <br>> Am 03-03-2017 06:00, schrieb tjlp@sina.com:<br>> <br>>> Hi,<br>>> <br>>> What I mention is the header in response from backend server. Your <br>>> answer about proxy_set_header is the "Connection" header in request.<br>>> <br>>> Thanks<br>>> Liu Peng<br>>> <br>>> ----- 原始邮件 -----<br>>> 发件人:Aleksandar Lazic <al-nginx@none.at><br>>> 收件人:nginx@nginx.org<br>>> 抄送人:tjlp@sina.com<br>>> 主题:Re: Issue about nginx removing the header "Connection" in HTTP <br>>> response?<br>>> 日期:2017年03月03日 06点25分<br>>> <br>>> Hi.<br>>> Am 01-03-2017 08:29, schrieb tjlp@sina.com:<br>>>> Hi, nginx guy,<br>>>> <br>>>> In our system, for some special requests, the upstream server will<br>>>> return a response which the header includes "Connection: Close".<br>>>> According to HTTP protocol, "Connection" is one-hop header.<br>>>> So, nginx will remove this header and the client can't do the <br>>>> business<br>>>> logic correctly.<br>>>> <br>>>> How to handle this scenario?<br>>> you mean something like this?<br>>> http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_set_header<br>>> If the value of a header field is an empty string then this field will<br>>> not be passed to a proxied server:<br>>> proxy_set_header Connection "";<br>>>> Thanks<br>>>> Liu Peng<br>>>> _______________________________________________<br>>>> nginx mailing list<br>>>> nginx@nginx.org<br>>>> http://mailman.nginx.org/mailman/listinfo/nginx<br></div>