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 have a server at 176.227.213.2. So I created a conf file for the default server (default.conf)

server {
    listen       80;
    server_name default 176.227.213.2;


    location / {
        root   /var/www/html;
        index  index.php index.html;
    }
.........

Full config. But I am not able to get even a single index.html to work. No response from server. The access log is empty, which I assume means, nginx is not listening to request at all. I have doubled checked the path and files.

I don't realize what is the problem here.

Update: Output of,

netstat -plutn

Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      590/sshd
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      855/sendmail: accep
tcp        0      0 127.0.0.1:9000          0.0.0.0:*               LISTEN      1991/php-fpm: maste
tcp        0      0 0.0.0.0:3306            0.0.0.0:*               LISTEN      756/mysqld
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      3031/nginx: master
tcp        0      0 0.0.0.0:10000           0.0.0.0:*               LISTEN      759/perl
tcp6       0      0 :::22                   :::*                    LISTEN      590/sshd
udp        0      0 0.0.0.0:10000           0.0.0.0:*                           759/perl

Update 2: After suggestion of @jamzed, I checked my iptables and realized that port 80 was not open. Added a rule for opening port, rebooted my system and it worked like a charm. Hope it helps!

share|improve this question
    
You can not access your website or any else error?Please post your error here –  Gnouc May 18 '13 at 19:04
    
@Gonuc: Absolutely nothing at all, Server takes too long to respond on my FF. Try 176.227.213.2. –  Shubham May 18 '13 at 19:06

2 Answers 2

up vote 1 down vote accepted

Try connect from localhost to localhost:

$ printf "GET / HTTP/1.0\r\n\r\n" | nc 127.0.0.1 80

or

$ telnet 127.0.0.1 80

Did you check firewall rules for port 80? also you can use tcpdump and check if the packets come to your webserver.

share|improve this answer
    
The printf command does give the right output. Does that indicate problem with Firewall? tcpdump gave a very verbose, never-ending, output –  Shubham May 18 '13 at 19:42

Problem maybe fastcgi_pass 127.0.0.1:9000;. Try change it to fastcgi_pass 176.227.213.2:9000;

Check your firewall rule, it can block traffic to 127.0.0.1

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.