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 / {

   }  
}
3
  • Can you provide your configuration? And maybe netstat -ln for good measure? Aug 16, 2012 at 3:54
  • 1. Show use exactly output you get when running wget 192.168.1.11? 2. As @ShaneMadden said, post your Nginx configuration?
    – quanta
    Aug 16, 2012 at 3:55
  • @ShaneMadden the nginx configuration? and I will add the netstat output.
    – nope
    Aug 16, 2012 at 3:56

1 Answer 1

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .