My configuration is:
Apache listening on port 80, Iptables redirecting port 80 to port 8080,
Nginx listening on port 8080.
I have been using Nginx with the same configuration for several months
(0.7.x and 0.8.x):
–conf-path=/etc/nginx/nginx.conf
–error-log-path=/var/log/nginx/error.log --pid-path=/var/run/nginx.pid
–lock-path=/var/lock/nginx.lock
–http-log-path=/var/log/nginx/access.log
–http-client-body-temp-path=/dev/shm/client
–http-proxy-temp-path=/dev/shm/proxy
–http-fastcgi-temp-path=/dev/shm/fastcgi --with-debug
–with-http_stub_status_module --with-http_flv_module
–with-http_ssl_module --with-http_dav_module
–with-http_secure_link_module
And until latest version i had no issue starting Nginx, yet today after
compiling 0.8.4 i got the following error:
the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
configuration file /usr/local/nginx/conf/nginx.conf test is successful
Starting nginx: : bind() to 0.0.0.0:80 failed (98: Address already in
use )
: bind() to 0.0.0.0:80 failed (98: Address already in use)
: bind() to 0.0.0.0:80 failed (98: Address already in use)
: bind() to 0.0.0.0:80 failed (98: Address already in use)
: bind() to 0.0.0.0:80 failed (98: Address already in use)
: still could not bind()
nginx.
Maybe i was not very clear, but the same configuration worked up to
0.8.3 included, upgrading to 0.8.4 fail due to bind issue, downgrading
to 0.8.3 works fine with no change in configuration.
And nginx listen on port 8080 (at least when running 0.8.3)
The real issue is that the 0.8.4 is trying to bind on port 80 while the
conf files are telling it to bind to port 8080. The configuration files
have not changed for months, it’s the first time i encounter the issue.
Yeah, okay, I figured that.
So you’re proxying apache to nginx then? That’s the wrong way to go!
If I wasn’t so lazy I would try 0.8.x on a box and see if I can
reproduce.
Either way though I wouldn’t be able to fix it. Maxim or Igor would be
able
to locate it pretty quick I’m sure. IIRC Igor might be on vacation I
think
too.
No !!! As i wrote on the first page the setup is as follow:
IPTABLES roots external access to port 80 to port 8080 which is NGinx
Listening Port.
From then on either NGinx serves all the pages or proxy them to Apache
depending on which Vhost is considered. So it’s really Nginx proxying to
Apache not the other way round. With this setup i can simply remove
Nginx by just erasing the IPTABLES rule.
This setup has not been changed for months, and it works for every Nginx
iteration up to 0.8.3, but fail with bind error on the 0.8.4 release.
I thought you had said iptables originally. Except according to your
lsof output port 80 is in use by apache2…
At least that’s what I gandered unless that was 8080 and it’s labeled
as www. I’m on my phone right now so it’s hard to go back and forth
but check that quick (if I’m not wrong about 8080 being labeled www as
well)
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
nginx 13779 root 6u IPv4 85204 TCP *:webcache (LISTEN)
nginx 13780 nginx 6u IPv4 85204 TCP *:webcache (LISTEN)
I then edited nginx.conf to have nginx listen on 80 and attempted a
reload. It failed. Output from error log:
2009/06/28 20:09:54 13787#0: signal process started
2009/06/28 20:09:54 13779#0: bind() to 0.0.0.0:80 failed (98: Address
already in use)
2009/06/28 20:09:54 13779#0: bind() to 0.0.0.0:80 failed (98: Address
already in use)
2009/06/28 20:09:54 13779#0: bind() to 0.0.0.0:80 failed (98: Address
already in use)
2009/06/28 20:09:54 13779#0: bind() to 0.0.0.0:80 failed (98: Address
already in use)
2009/06/28 20:09:54 13779#0: bind() to 0.0.0.0:80 failed (98: Address
already in use)
2009/06/28 20:09:54 13779#0: still could not bind()
The most logical conclusion is that with your latest compile the path to
nginx.conf was changed or nginx.conf was overwritten.
Please post the output of
nginx -V
(for both nginx-0.8.3 and nginx-0.8.4)
and the contents of nginx.conf file that is specified by each.
Posted at Nginx Forum:
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.