This is on a fresh install of Ubuntu 14.04 running on a VPS.
For example the following will work:
server {
listen 8080 default_server;
root /var/www;
location / {
try_files $uri $uri/ =404;
}
}
server {
listen 80 default_server;
root /var/www;
location / {
try_files $uri $uri/ =404;
}
}
When I visit the page it will be my index.html
.
But if I try to make nginx listen on another port (35729):
server {
listen 35729 default_server;
root /var/www;
location / {
try_files $uri $uri/ =404;
}
}
or even one that's maybe slightly more used (3000 by nodejs servers for example)
All I get is an error saying the webpage is not available. .
Looking in netstat though says that nginx is listening for the port:
tcp 0 0 0.0.0.0:35729 0.0.0.0:* LISTEN 15349/nginx -g daem
and iptables looks like this (which means no firewall right?)
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
and sudo ufw status verbose
yields
Status: inactive
What's going on?