0

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;
    server_name testserver.turnleftllc.com;

    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  --  *      *       0.0.0.0/0            0.0.0.0/0           state RELATED,ESTABLISHED
    0     0 ACCEPT     icmp --  *      *       0.0.0.0/0            0.0.0.0/0
    0     0 ACCEPT     all  --  lo     *       0.0.0.0/0            0.0.0.0/0
    2    96 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           state NEW tcp dpt:22
  139  7251 REJECT     all  --  *      *       0.0.0.0/0            0.0.0.0/0           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  --  *      *       0.0.0.0/0            0.0.0.0/0           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)
4

Two hypotheses come to mind.

Firstly, that name resolution isn't working. Could you do a dig testserver.turnleftllc.com 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?

  • 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. – Thomas Thorogood Jan 5 '12 at 19:42
  • 2
    @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. – Thomas Thorogood Jan 5 '12 at 19:48
  • 2
    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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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