Welcome! Log In Create A New Profile

Advanced

why is nginx binding to 0.0.0.0:80 when I specify explicit IPs to listen on?

All files from this thread

File NameFile Size Posted byDate 
smime.p7s6 KBopen | downloadGreenGecko01/22/2013Read message
January 22, 2013 05:15PM
I'm having a difficult time understanding why I'm unable to limit the IP address to which nginx binds.

nginx 1.2.6-1
Linux 3.2.0-4-amd64 #1 SMP Debian 3.2.35-2 x86_64 GNU/Linux


================
root@skokomish:/etc/nginx# netstat -pant |grep nginx
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 7768/nginx
tcp 0 0 66.113.100.140:81 0.0.0.0:* LISTEN 7768/nginx

shows that it is binding on port 80 of all IP addresses.
=================
Yet each of my hosts is explicitly listening on a single IP address:

root@skokomish:/etc/nginx/sites-available# more default
{ listen 127.0.0.1:80; }
=================
root@skokomish:/etc/nginx/sites-available# more example
server
{
server_name example.com www.example.com;
listen 66.113.100.140:80;
access_log /var/log/ngnix/example.log;
error_log /var/log/nginx/example.error.log;

location /site {
alias /data/www/content/site/example;
}
location / {
proxy_pass_header Server;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Scheme $scheme;
proxy_connect_timeout 10;
proxy_read_timeout 10;
proxy_pass http://10.15.20.10:8107/;
}
}


==========================
There is no 'listen' statement in nginx.conf itself:
root@skokomish:/etc/nginx# grep listen nginx.conf
# listen localhost:110;
# listen localhost:143;
==========================
Grepping for 'listen' shows:

root@skokomish:/etc/nginx# for i in `find .`; do grep listen $i; done|sort|uniq
grep: .: Is a directory
grep: ./sites-enabled: Is a directory
grep: ./conf.d: Is a directory
grep: ./sites-available: Is a directory
{ listen 127.0.0.1:80; }
listen 66.113.100.140:80;
listen 66.113.100.140:81;
# listen localhost:110;
# listen localhost:143;
root@skokomish:/etc/nginx# ls conf.d
root@skokomish:/etc/nginx#

==================================
Thanks in advance.

-Steve W.
SubjectAuthorPosted

why is nginx binding to 0.0.0.0:80 when I specify explicit IPs to listen on?

middleforkgisJanuary 22, 2013 05:15PM

RE: why is nginx binding to 0.0.0.0:80 when I specify explicit IPs to listen on?

Lukas TribusJanuary 22, 2013 07:28PM

Re: why is nginx binding to 0.0.0.0:80 when I specify explicit IPs to listen on?

middleforkgisJanuary 22, 2013 09:43PM

Re: why is nginx binding to 0.0.0.0:80 when I specify explicit IPs to listen on?

middleforkgisJanuary 22, 2013 09:59PM

Re: why is nginx binding to 0.0.0.0:80 when I specify explicit IPs to listen on? Attachments

GreenGeckoJanuary 22, 2013 10:08PM

Re: why is nginx binding to 0.0.0.0:80 when I specify explicit IPs to listen on?

middleforkgisJanuary 22, 2013 11:19PM

Re: why is nginx binding to 0.0.0.0:80 when I specify explicit IPs to listen on?

Igor SysoevJanuary 23, 2013 12:10AM

SOLVED Re: why is nginx binding to 0.0.0.0:80 when I specify explicit IPs to listen on?

middleforkgisJanuary 23, 2013 11:05AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 97
Record Number of Users: 7 on March 06, 2014
Record Number of Guests: 229 on August 01, 2014
Powered by nginx    Powered by FreeBSD    PHP Powered    Powered by Percona     ipv6 ready