I'm working my way through my first nginx / gunicorn / flask deployment using a stock Amazon Lightsail Ubuntu server. At this point, I'm ignoring gunicorn and flask, and just trying to get nginx to serve my static files.
I am able to get a static file while ssh-ed into the server using:
curl -k https://localhost/static/test.txt
However, when I attempt to access the url https://my.ip.add.here/static/test.txt
the request times out.
I'm running ufw
with 80 and 443 (and 22) open, but even disabling it does not solve the problem.
I do not see any errors in /var/log/nginx/error.log
or /var/log/nginx/access.log
. (Although it appears that the logs don't contain my most recent successful curl
attempts, do they need to get flushed in any way?)
Can anyone suggest what the problem might be, or where I should look for additional errors?
[UPDATE] Here are the results from ss-ntlpe
:
State Recv-Q Send-Q Local Address:Port Peer Address:Port
LISTEN 0 128 *:80 *:*
users:(("nginx",pid=17623,fd=6),("nginx",pid=6845,fd=6)) ino:26170 sk:1 <->
LISTEN 0 128 *:22 *:*
users:(("sshd",pid=1371,fd=3)) ino:16267 sk:2 <->
LISTEN 0 128 *:443 *:*
users:(("nginx",pid=17623,fd=13),("nginx",pid=6845,fd=13)) ino:28373 sk:3 <->
LISTEN 0 128 127.0.0.1:8000 *:*
users:(("gunicorn",pid=17582,fd=5),("gunicorn",pid=17580,fd=5),("gunicorn",pid=17578,fd=5)
,("gunicorn",pid=17577,fd=5),("gunicorn",pid=17574,fd=5)) uid:1000 ino:45243 sk:4 <->
LISTEN 0 128 :::22 :::*
users:(("sshd",pid=1371,fd=4)) ino:16269 sk:5 v6only:1 <->
You need to grant access through the management console in the first place. The configuration changes you would make on a physical system, seem to have a very limited effect inside an AWS.