map module not working with new 1.1.0

Maxim Dounin mdounin at mdounin.ru
Wed Aug 10 01:01:49 UTC 2011


Hello!

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

> 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.

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 Dounin

> 
> Rami
> 
> On Tue, Aug 9, 2011 at 8:22 PM, Maxim Dounin <mdounin at mdounin.ru> wrote:
> 
> > Hello!
> >
> > On Tue, Aug 09, 2011 at 07:45:47PM -0400, Rami Essaid wrote:
> >
> > > 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;
> > >   }
> > > ...
> >
> > Works fine here in 1.1.0.
> >
> > Maxim Dounin
> >
> > _______________________________________________
> > nginx mailing list
> > nginx at nginx.org
> > http://mailman.nginx.org/mailman/listinfo/nginx
> >
> 
> 
> 
> -- 
> Cheers,
> Rami

> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx



More information about the nginx mailing list