Forum: NGINX Nginx Map Module Help

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Ef5effe1ff64e4ab2c0bb98137e99d3c?d=identicon&s=25 Resi Cow (Guest)
on 2009-03-19 19:26
(Received via mailing list)
Hello,

I am looking at using Nginx and specifically the Map Module.

http://wiki.nginx.org/NginxHttpMapModule

I have used the rewrite map stuff in Apache, and I know in Apache you
can
load a key / value pair list from a text file. I had assumed looking at
the
examples on the Wiki that the values needed to be included with the
configuration, but then I noticed that at the end of the Wiki page on
the
Nginx Map Module there was this:

include — the maps will be included from a file, or even from multiple
files
when using wildcards.

How does this work? I was hoping someone with some experience can
elaborate
on this feature, as I was unable to find additional information on this.

1) So can the values actually be pulled from a file instead?
2) What type of file, what format?
3) If the map file is updated, does Nginx need to be restarted for the
changes to take effect?

I apologize if these questions have already been answered somewhere, I
searched and searched and only found that single reference to the
"include"
support in the Map Module.

Thanks,

John
A8108a0961c6087c43cda32c8616dcba?d=identicon&s=25 Maxim Dounin (Guest)
on 2009-03-19 20:22
(Received via mailing list)
Hello!

On Thu, Mar 19, 2009 at 01:18:41PM -0500, Resi Cow wrote:

> Nginx Map Module there was this:
> changes to take effect?
>
> I apologize if these questions have already been answered somewhere, I
> searched and searched and only found that single reference to the "include"
> support in the Map Module.

http://wiki.nginx.org/NginxHttpMainModule#include

It's just include of configuration chunk.  If it's updated - it's
effectively updated configuration, and you should instruct nginx
to reload configuration as usual via SIGHUP.

Maxim Dounin
561c2fb6d0c72e0c7bc52b263c7d56c3?d=identicon&s=25 Merlin (Guest)
on 2009-03-19 20:23
(Received via mailing list)
I think it simply references the include support in nginx core:
http://wiki.nginx.org/NginxHttpMainModule#include

It means you can have files that contain the map directives and use
include
to include them into your configuration as needed.

- Merlin
Ef5effe1ff64e4ab2c0bb98137e99d3c?d=identicon&s=25 Resi Cow (Guest)
on 2009-03-20 23:06
(Received via mailing list)
Okay thanks, I wasn't sure.

I am no expert, but I looked at the nginx source and I saw this in the
map
module code:

return ngx_conf_parse(cf, &file);

and some other references to a file.

So are you saying that we can use the include command from the main
module
to include a file defining a map, or does the Map module have its own
include functionality?

Thanks,

John
This topic is locked and can not be replied to.