Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I just did a fresh nginx install on Fedora 14 (yum install nginx) and got it configured with the following server inclusion:

server {
    listen      80;
    root        /var/www/html/test;

    location / {
        index   index.htm;

ps aux | grep nginx
    root      1986  0.0  0.7  98056  1952 ?        Ss   18:55   0:00 nginx: master process /usr/sbin/nginx
    root      1987  0.0  1.0  98584  2656 ?        S    18:55   0:00 nginx: worker process

However, when pointing my browser to that domain name, it just hangs and then comes back with "Could not connect..."

The permissions for everything in /var/www/html is set to 775. I've been running nginx on another server for a long while and never encountered this issue. It was always very easy in the past. Any thoughts on what's causing this?

I'm sure it's painfully obvious and I'll feel like a total moron when I figure out what it is.

[root@resolution ~]# iptables -L -n -v
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination
 3051  243K ACCEPT     all  --  *      *             state RELATED,ESTABLISHED
    0     0 ACCEPT     icmp --  *      *  
    0     0 ACCEPT     all  --  lo     *  
    2    96 ACCEPT     tcp  --  *      *             state NEW tcp dpt:22
  139  7251 REJECT     all  --  *      *             reject-with icmp-host-prohibited

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination
    0     0 REJECT     all  --  *      *             reject-with icmp-host-prohibited

Chain OUTPUT (policy ACCEPT 2610 packets, 341K bytes)
 pkts bytes target     prot opt in     out     source               destination

[root@resolution ~]# lsof -i -P | grep :80
nginx   1986 root    7u  IPv4   9807      0t0  TCP *:80 (LISTEN)
nginx   1987 root    7u  IPv4   9807      0t0  TCP *:80 (LISTEN)
share|improve this question
What do you get from lsof -i -P | grep :80? – Shane Madden Jan 5 '12 at 19:24
done. results posted above. – Tom Thorogood Jan 5 '12 at 19:43
up vote 4 down vote accepted

Two hypotheses come to mind.

Firstly, that name resolution isn't working. Could you do a dig on the client (or OS-equivalent, if the client's not running linux) and confirm that the IP address of the nginx server is returned?

Secondly, that the F14 box is firewalling. Could you do an iptables -L -n -v on the F14 server and post the results as an edit above?

Not that this is in any way relevant to the question, but could I gently remind you that F14 is now out of support, and you shouldn't think of deploying any kind of production system on it?

share|improve this answer
Dig turns up the IP address without any issue. That was my first thought also. Other will be posted above as requested momentarily. And regarding f14: sadly, it's not up to me. Our IT department has decreed that this is what this server will be using. – Tom Thorogood Jan 5 '12 at 19:42
@TomThorogood iptables it is; your INPUT chain is only accepting TCP port 22 (SSH). You'll need to add 80. – Shane Madden Jan 5 '12 at 19:46
Thanks, @Shane. I have no idea how to do that. That is new to me. – Tom Thorogood Jan 5 '12 at 19:48
Something along these lines: iptables -I INPUT 4 -p tcp --dport 80 -m state --state NEW -j ACCEPT – Shane Madden Jan 5 '12 at 19:54
That did it. Thanks so much! – Tom Thorogood Jan 5 '12 at 19:55

Your Answer


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.