Welcome! Log In Create A New Profile

Advanced

bug in listen in 0.6.{32,35}?

April 15, 2009 12:53PM
Hey All,

We're extremely happily using nginx 0.5.blah for much hosting.
0.5.x isn't broke, so we have no plans to "fix" it in the forseable future. However, we have a good use for gzip_static, so have to move to 0.6.x for some servers.

I'm having trouble converting our config style from 0.5.x to 0.6.x, "listen" isn't working how it used to, or how the documentation says it should.
Each server has it's own IP address, and a series of extra IP addresses for serving content. To save serious headaches we need to use the same config on multiple machines, in different data centres.
Previously a config like this worked as expected:

server {
listen *:80 default bind;
server_name hostname1.dc1.blah hostname2.dc1.blah hostname.dc2.blah
}
server {
listen 192.168.36.20:80;
listen 192.168.136.20:80;
server_name www.blah.com;
}
server {
listen 192.168.36.20:80;
listen 192.168.136.20:80;
server_name www.foo.com;
}

nginx would bind to *:80 and not complain that it doesn't have any of the other IPs.
With nginx 0.6.35 (and 0.6.32) that configuration fails the test, and logs this:

2009/04/15 17:12:19 [emerg] 4767#0: bind() to 192.168.36.80:80 failed (99: Cannot assign requested address)

If I take out listen directives for IPs this machine does not have, the config test passes, but it still won't start, with logs like this:

2009/04/15 17:02:20 [emerg] 4702#0: bind() to 127.0.0.1:80 failed (98: Address already in use)
2009/04/15 17:02:20 [emerg] 4702#0: bind() to 192.168.136.80:80 failed (98: Address already in use)
2009/04/15 17:02:20 [notice] 4702#0: try again to bind() after 500ms
2009/04/15 17:02:20 [emerg] 4702#0: bind() to 127.0.0.1:80 failed (98: Address already in use)
2009/04/15 17:02:20 [emerg] 4702#0: bind() to 192.168.136.80:80 failed (98: Address already in use)
2009/04/15 17:02:20 [notice] 4702#0: try again to bind() after 500ms
2009/04/15 17:02:20 [emerg] 4702#0: still could not bind()


Am I missing something, or should this not have worked before (in which case, what should I be doing?), or have I found a bug?

Many thanks
Mike
Subject Author Posted

bug in listen in 0.6.{32,35}?

mikew April 15, 2009 12:53PM

Re: bug in listen in 0.6.{32,35}?

SSSlippy April 15, 2009 02:31PM

Re: bug in listen in 0.6.{32,35}?

mikew April 15, 2009 02:50PM

Re: bug in listen in 0.6.{32,35}?

Igor Sysoev April 15, 2009 02:39PM

Re: bug in listen in 0.6.{32,35}?

Igor Sysoev April 15, 2009 02:38PM

Re: bug in listen in 0.6.{32,35}?

Michael Ching April 15, 2009 02:50PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 209
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready