I just installed nginx by doing sudo yum install nginx and I'm unable to connect to it on port 80.
I tried stopping iptables by doing sudo service iptables start and was still unable to connect.
I'm testing this out by doing telnet localhost 80. Here's the output I'm getting back:
Trying 127.0.0.1...
telnet: connect to address 127.0.0.1: Connection refusedWhen I try telnet localhost 22 it works as I'd expect it to:
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
SSH-2.0-OpenSSH_5.3Any ideas?
2 Answers
Are you actually running it?
I'd do:
netstat -lnt | grep 80and see if something is actually running. If you're root, you could do:
netstat -lntp | grep 80And it would show you the PID as well.
If you just brought it down, I wouldn't guarantee it's configured to run on port 80 anyway. It may be configured for another port, for testing.
2Try:
http{ server { listen 80; listen localhost; # <-probably will fix your problem. location / { root /data/www; } location /images/ { root /data; } }