Not able start Nginx

I have logged in via Basic SSH and install nginx but im not able to curl. Please help me resolve this.
root@xxx:/# service nginx status
* nginx is running
root@xxx:/# curl localhost
curl: (7) Failed to connect to localhost port 80 after 0 ms: Connection refused
root@xxx:/# netstat -tuln | grep :80
tcp 0 0 0.0.0.0:8081 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:8001 0.0.0.0:* LISTEN
root@xxx:/# service nginx status
* nginx is running
root@xxx:/# curl localhost
curl: (7) Failed to connect to localhost port 80 after 0 ms: Connection refused
root@xxx:/# netstat -tuln | grep :80
tcp 0 0 0.0.0.0:8081 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:8001 0.0.0.0:* LISTEN
Solution:
This is resolved. The template had default nginx.conf was changed and it didn't load the sites-enabled config.
Jump to solution
5 Replies
nerdylive
nerdylive6mo ago
is your Nginx started on port 80? seems to be listening in 0.0.0.0:8081 right?, check your nginx config too
digigoblin
digigoblin6mo ago
You can use
netstat -tnlup | grep -i listen | grep nginx
netstat -tnlup | grep -i listen | grep nginx
That will show you which port(s) is listening on
GokulaKrishna
GokulaKrishnaOP6mo ago
This is my config
server {
listen 80 default_server;
listen [::]:80 default_server;
}
server {
listen 80 default_server;
listen [::]:80 default_server;
}
That's partial config
digigoblin
digigoblin6mo ago
Remove the ipv6 stuff.
Solution
GokulaKrishna
GokulaKrishna6mo ago
This is resolved. The template had default nginx.conf was changed and it didn't load the sites-enabled config.
Want results from more Discord servers?
Add your server