Hi,<div><br></div><div>Thanks. I did some tests:</div><div><br></div><div>(A) Set X-AAA at http level and do nothing at server level.</div><div>OK.</div><div><br></div><div>(B) Set X-AAA at http level and set X-BBB at server level.</div>
<div>Only X-BBB is set and sent to backend.</div><div><br></div><div>So the inheritance mechanism of proxy_set_header works in a All-None mode. If there is any directive set at a smaller block, all the values set by bigger block are cancelled.</div>
<div><br></div><div>Is it possible to change this behavior to the normal inheritance mechanism so setting directive at smaller block only cancel the same directive at bigger block? </div><div><div><br><div class="gmail_quote">
On Thu, Jan 6, 2011 at 1:09 AM, Maxim Dounin <span dir="ltr">&lt;<a href="mailto:mdounin@mdounin.ru">mdounin@mdounin.ru</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hello!<br>
<div><div></div><div class="h5"><br>
On Wed, Jan 05, 2011 at 10:42:09PM +0800, 杨镭 wrote:<br>
<br>
&gt; Hi all,<br>
&gt;<br>
&gt;   Although the documentation (<br>
&gt; <a href="http://wiki.nginx.org/HttpProxyModule#proxy_set_header" target="_blank">http://wiki.nginx.org/HttpProxyModule#proxy_set_header</a>) says the context of<br>
&gt; proxy_set_header  can be http, server, location,we found that<br>
&gt; proxy_set_header directive at http level does not work. When moved to server<br>
&gt; level, everything works fine.<br>
&gt;<br>
&gt;   Setting proxy_set_header at http level allows us to centralize some common<br>
&gt; settings thus avoid manually copy those directives to each virtual host when<br>
&gt; it was created. e.g., we use X-Http-Scheme header to let backend server know<br>
&gt; if it&#39;s a https request, otherwise they can&#39;t know.<br>
<br>
</div></div>It works at http level just fine.  Most likely you&#39;ve defined<br>
proxy_set_header at server level as well, and this cleared<br>
values set on http level.  Note the following in wiki:<br>
<br>
% proxy_set_header directives issued at higher levels are only<br>
% inherited when no proxy_set_header directives have been issued at<br>
% a given level<br>
<br>
Maxim Dounin<br>
<br>
_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org">nginx@nginx.org</a><br>
<a href="http://nginx.org/mailman/listinfo/nginx" target="_blank">http://nginx.org/mailman/listinfo/nginx</a><br>
</blockquote></div><br></div></div>