Nginx – Ubuntu 12.04 open port 80 inside VLAN

firewallnginxUbuntu

I have an nginx server running on ubuntu 12.04 that serves http through port 80 and https through port 443.

Everything works fine if I access it from the same computer via localhost, 127.0.0.1 or the local IP 192.168.0.11. If I try to access the server from another computer in the same VLAN it does not work for http; it works for https. I have changed my nginx configuration to also listen to port 8000 for http; I can then access http from the other computer in the same VLAN via "http://192.168.0.11:8000".

I also have a web server running on port 80 on a windows machine and can access it from another device in the same VLAN, therefore the router is not blocking incoming http traffic.

The nginx process is run by root. I have used tcpdump and I see that packets are arriving to Ubuntu:
192.168.0.16.49735 > 192.168.0.11.80
and that some response is being given
192.168.0.11.80 > 192.168.0.16.49735
(I do not know what the response is though). There is no request arriving at the nginx web server (I have checked the access log).

I have iptables empty. I have unsuccessfully tried to find a solution for a long time to this, it has now become a matter of happiness or bitterness :).

Best Answer

This is not really a solution, but comments are gettting too big.

Now you might want to know if the problem comes from os/network or from nginx.

One way to achieve this is :

  • Shut down nginx and check there is no remaining process (I guess your server is not already in production).

  • Start netcat on port 80. Can be nc -l -p 80 but depends which netcat you use

  • From another box type telnet 192.168.0.11 80 and start typing ramdom stuff. The random stuff should appear in the terminal where you started netcat. If not, try capturing traffic with tcpdump again.

If you can't reproduce your RST, ACK problem with netcat, nginx is likely to be the problem.

Related Topic