<div dir="ltr">Thanks ryd994 for the suggestion! 1 and 2 are working now.<div>Anyone else has any ideas on 3?</div><div><br></div><div>Frank</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Aug 14, 2015 at 10:36 AM, ryd994 <span dir="ltr"><<a href="mailto:ryd994@163.com" target="_blank">ryd994@163.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr">Hi,</p>
<p dir="ltr">1) Use mapped variable</p>
<p dir="ltr">map $http_<header you want to change> $<some variable name> {<br>
"" "value if nit set";<br>
default $http_<header you want to change>;<br>
}<br>
Then you can set header with the new variable.</p>
<p dir="ltr">2) I guess you can use map, too. Use $upstream_http_<i>name</i> instead.</p>
<p dir="ltr">3) Sorry, I have no idea on this.</p>
<br><div class="gmail_quote"><div><div class="h5"><div dir="ltr">On Sat, Aug 15, 2015, 00:51 Frank Liu <<a href="mailto:gfrankliu@gmail.com" target="_blank">gfrankliu@gmail.com</a>> wrote:<br></div></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr">Hi,<br><br>I have a few questions regarding headers in nginx:<br><br>1) I use proxy_set_header to pass a header to upstream servers. Is it possible to honor the header if the incoming request already has it?<br><br>2) I want to pass the "Server" header from upstream response to clients, and if there is no such response header, I'd like to add a customer one. Is it possible via core nginx or any third party modules? Currently I am using "proxy_pass_header Server" without any check. I am not sure what happens if upstream response doesn't have it.<br><br>3) I am trying to log an upstream response header to access log but it has a "dot" in it (say X.header). I don't have any control to the upstream servers. On nginx side, I tried setting "ignore_invalid_headers off" in the server block, and in the logformat, I tried a few things for the the column: $upstream_http_x.header $upstream_http_x_header $upstream_http_x-header, but nothing works. Any ideas how I can log it?<br><br>Thanks!<br>Frank<br></div></div></div>
_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org" target="_blank">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" rel="noreferrer" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx</a></blockquote></div>
<br>_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" rel="noreferrer" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx</a><br></blockquote></div><br></div>