Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

   }  
}
share|improve this question
    
Can you provide your configuration? And maybe netstat -ln for good measure? –  Shane Madden Aug 16 '12 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 '12 at 3:55
    
@ShaneMadden the nginx configuration? and I will add the netstat output. –  nope Aug 16 '12 at 3:56

1 Answer 1

up vote 2 down vote accepted
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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.