# Map module not working with new 1.1.0

**URL:** <https://www.ruby-forum.com/t/map-module-not-working-with-new-1-1-0/210512>\
**Category:** NGINX\
**Created:** [August 10, 2011, 1:46am UTC](https://www.ruby-forum.com/t/map-module-not-working-with-new-1-1-0/210512 "2011-08-10T01:46:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![luislavena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/0ea827/32.png) [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Post date:** [August 10, 2011, 1:46am UTC](https://www.ruby-forum.com/t/map-module-not-working-with-new-1-1-0/210512/1 "2011-08-10T01:46:06Z")

</div>

Hi Guys,

Has anyone experienced any issues with the map module using the new  
1.1.0  
compile of nginx? I am mapping user agents and under 1.0.5 everything  
worked great, with the new version the exact same config doesnt seem to  
be  
working. I’ve tried two different maps based on previous comments and  
neither seem to work. Anyone else?

http {  
…  
map $http\_user\_agent $searchengine {  
default 0;  
~(?i)mozilla 1;  
~\*mozilla 1;  
}  
…  
location / {  
…  
if ($searchengine){  
#return 418;  
rewrite ^ /testing/ redirect;  
}  
…

---

<div class="post-metadata">

**Author:** ![Rami\_E](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/f05b48/32.png) [@Rami\_E](https://www.ruby-forum.com/u/Rami_E)\
**Post date:** [August 10, 2011, 2:22am UTC](https://www.ruby-forum.com/t/map-module-not-working-with-new-1-1-0/210512/2 "2011-08-10T02:22:28Z")

</div>

Hello!

On Tue, Aug 09, 2011 at 07:45:47PM -0400, Rami E. wrote:

> …  
> rewrite ^ /testing/ redirect;  
> }  
> …

Works fine here in 1.1.0.

Maxim D.

---

<div class="post-metadata">

**Author:** ![Rami\_E](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/f05b48/32.png) [@Rami\_E](https://www.ruby-forum.com/u/Rami_E)\
**Post date:** [August 10, 2011, 2:36am UTC](https://www.ruby-forum.com/t/map-module-not-working-with-new-1-1-0/210512/3 "2011-08-10T02:36:02Z")

</div>

I am so sorry for the false alarm. When testing nginx I reload the  
config  
using the nginx -s reload command. Because I am using a virtual  
environment my IP address had shift and the config IP mapping was no  
longer  
accurate but the reload command did not notify me of the conflict.  
After  
killing nginx and starting it again it gave me the proper error code:  
nginx: [emerg] bind() to 10.2.10.236:80 failed (99: Cannot assign  
requested  
address)

This is a small thing I guess but it would have been nice when using the  
reload command that it informed me that something was wrong instead of  
just  
not accepting the changes I made.

Rami

---

<div class="post-metadata">

**Author:** ![Rami\_E](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/f05b48/32.png) [@Rami\_E](https://www.ruby-forum.com/u/Rami_E)\
**Post date:** [August 10, 2011, 3:02am UTC](https://www.ruby-forum.com/t/map-module-not-working-with-new-1-1-0/210512/4 "2011-08-10T03:02:35Z")

</div>

Hello!

On Tue, Aug 09, 2011 at 08:35:25PM -0400, Rami E. wrote:

> not accepting the changes I made.  
> On reload nginx doesn’t reopen listen sockets as long as they  
> haven’t changed in config, so it will never know your ips are no  
> longer valid.

If something actually goes wrong during reload - nginx will log  
appropriate information to global error before giving up. Note  
that it’s already running master process which does a reload and  
there is no way to log to console (“nginx -s reload” merely sends  
SIGHUP to running nginx master process and was introduced mainly  
for Windows where one can’t do “kill -HUP”).

Maxim D.

> > > map $http\_user\_agent $searchengine {  
> > > }
> 
> –  
> Cheers,  
> Rami
