Hi Igor and Maxim,<div><br></div><div>Thanks for the reply!<br><br><div class="gmail_quote">On Thu, May 5, 2011 at 4:35 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 class="im"><br>
On Thu, May 05, 2011 at 02:59:21AM +0800, 杨镭 wrote:<br>
<br>
</div><div class="im">&gt; Hi,<br>
&gt;<br>
&gt; The context of map directive is *http* as documented on <a href="http://wiki.nginx.org" target="_blank">wiki.nginx.org</a>. This<br>
<br>
</div>Yes.<br>
<div class="im"><br>
&gt; means all the requests will go through the map filter phase.<br>
<br>
</div>No.  Map directive creates a variable and only does something when<br>
(and if) the variable is accessed.  There is no performance<br>
penalty for processing requests which doesn&#39;t use the variable.<br>
<div class="im"><br>
&gt; This is not ideal when you have many virtual hosts.<br>
&gt;<br>
&gt; For example, we&#39;ve 50+ virtual hosts. When one of them need map variables,<br>
&gt; the others automatically inherited those settings because there is no way to<br>
&gt; limit it to server context.<br>
&gt;<br>
&gt; If this is the situation, can someone know the internals of nginx explain<br>
&gt; why the map module can&#39;t work at server level.<br>
<br>
</div>Changing map module to provide data based on per-server configs is<br>
possible, but obviously will require extra code.<br>
<font color="#888888"><br>
Maxim Dounin<br>
</font><div><div></div><div class="h5"><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>
</div></div></blockquote></div><br></div>