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"><<a href="mailto:mdounin@mdounin.ru">mdounin@mdounin.ru</a>></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">> Hi,<br>
><br>
> 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>
> 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't use the variable.<br>
<div class="im"><br>
> This is not ideal when you have many virtual hosts.<br>
><br>
> For example, we've 50+ virtual hosts. When one of them need map variables,<br>
> the others automatically inherited those settings because there is no way to<br>
> limit it to server context.<br>
><br>
> If this is the situation, can someone know the internals of nginx explain<br>
> why the map module can'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>