question about the context of map directive

杨镭 clanherb at gmail.com
Thu May 5 06:14:55 MSD 2011


Hi Igor and Maxim,

Thanks for the reply!

On Thu, May 5, 2011 at 4:35 AM, Maxim Dounin <mdounin at mdounin.ru> wrote:

> Hello!
>
> On Thu, May 05, 2011 at 02:59:21AM +0800, 杨镭 wrote:
>
> > Hi,
> >
> > The context of map directive is *http* as documented on wiki.nginx.org.
> This
>
> Yes.
>
> > means all the requests will go through the map filter phase.
>
> No.  Map directive creates a variable and only does something when
> (and if) the variable is accessed.  There is no performance
> penalty for processing requests which doesn't use the variable.
>
> > This is not ideal when you have many virtual hosts.
> >
> > For example, we've 50+ virtual hosts. When one of them need map
> variables,
> > the others automatically inherited those settings because there is no way
> to
> > limit it to server context.
> >
> > If this is the situation, can someone know the internals of nginx explain
> > why the map module can't work at server level.
>
> Changing map module to provide data based on per-server configs is
> possible, but obviously will require extra code.
>
> Maxim Dounin
>
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://nginx.org/mailman/listinfo/nginx
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nginx.org/pipermail/nginx/attachments/20110505/94632ff8/attachment.html>


More information about the nginx mailing list