0

I installed nginx on debian and then tested it with wget localhost and wget 192.168.1.11 to see if it responds to simple requests. After this i changed the default root folder to /var/www and tried testing again.
Now if i try wget locahost it works, but wget 192.168.1.11 gets "connection refussed". I'm thinking it's a permissions problem, but I can't find a long anywhere that would tell me anything about this. I tried searching through all the files inside /var/log and /var/log/nginx but there is nothing there.
Is there another place where the system logs failed connection attempts? And if not, does anyone know a way I could find the reason for this problem?

wget 192.168.1.11 
--2012-08-16 05:59:38-- http://192.168.1.11/  
Connecting to 192.168.1.11:80... failed: Connection refused.

nginx configuration:

server {  
   listen 127.0.0.1:80;  
   server_name testing;  
   root /var/www;  
   index index.php index.html index.htm;  

   location / {

   }  
}
quanta
  • 51,413
  • 19
  • 159
  • 217
nope
  • 113
  • 4

1 Answers1

2
listen 127.0.0.1:80;

Means that Nginx is only listening on 127.0.0.1. Look at the output of netstat --inet -nlp | grep :80, you will see something like this:

tcp        0      0 127.0.0.1:80            0.0.0.0:*               LISTEN      11789/nginx.conf

To make the server accessible via the LAN address (192.168.1.11), add a listen directive:

listen 127.0.0.1:80;
listen 192.168.1.11:80;

then restart Nginx and try again.

Adam Baxter
  • 238
  • 2
  • 9
quanta
  • 51,413
  • 19
  • 159
  • 217