server_name and listen behaviour

ivan babrou ibobrik at gmail.com
Tue Feb 12 17:10:17 UTC 2013


Hi, I have a question. It's better to describe with example

I point one.local and two.local to 127.0.0.1 and create following servers
in config for nginx:

server {
  listen 80;
  server_name one.local;

  location / {
    return 404;
  }
}

server {
  listen two.local:80;
  server_name two.local;

  location / {
    return 403;
  }
}

If I request one.local then 403 is returned. If i change listen for
one.local to one.local:80 then 404 correctly returned, but only after
restart, reload doesn't help (that's probably bug too).

I expect to get 404 if i request one.local even if I listen on all
addresses. Am I right?

Thanks!

-- 
Regards, Ian Babrou
http://bobrik.name http://twitter.com/ibobrik skype:i.babrou
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx-devel/attachments/20130212/a54dc49f/attachment.html>


More information about the nginx-devel mailing list