Ildar
Ildar

Reputation: 796

Nginx doesn't work in local network

os centos 6.3 Nginx doesn't work in local network, but it works in localhost. Tested by elinks.

# ps -ef | grep nginx
root      1447     1  0 Aug07 ?        00:00:00 nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf
nginx     1448  1447  0 Aug07 ?        00:00:00 nginx: worker process

# netstat -napt | grep nginx
tcp        0      0 0.0.0.0:80                  0.0.0.0:*                   LISTEN      1447/nginx

# iptables --list
Chain INPUT (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     all  --  anywhere             anywhere            state RELATED,ESTABLISHED 
ACCEPT     icmp --  anywhere             anywhere            
ACCEPT     all  --  anywhere             anywhere            
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:ssh 
REJECT     all  --  anywhere             anywhere            reject-with icmp-host-prohibited 

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         
REJECT     all  --  anywhere             anywhere            reject-with icmp-host-prohibited 

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

# cat /etc/sysconfig/selinux

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
#     targeted - Targeted processes are protected,
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted

Upvotes: 0

Views: 2999

Answers (1)

Mark Stosberg
Mark Stosberg

Reputation: 13381

It sounds like this is not an Nginx problem. Do you see any access attempts in the Nginx access or error logs? You should if it's an Nginx issue.

Your netstat output shows that Nginx is running and listening on Port 80 on all IPs.

Try using nmap to port scan yourself and confirm something running on port 80 is detected:

nmap -vv -P0 (server IP address or DNS)

If it doesn't find anything, it sounds like it's being blocked somewhere else. Talk to your network administrator.

Upvotes: 1

Related Questions