curl connection refused

Joel Parker at
Mon Dec 18 19:21:41 UTC 2017

I have seen this a lot on google but have not been able to find a suitable
solution. My firewall is setup correctly.

I am listening on port 80

netstat -anltp
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address
State       PID/Program name
tcp        0      0    *
LISTEN      1114/nginx: master

curl localhost - works
curl -works when running on the local machine

but when I try to run it from the outside, I get:

curl: (7) Failed to connect to port 80: Connection refused

I have made the config as simple as possible but have not figured out a way
to run
curl from another machine

Here is the config:

# cat nginx.conf
load_module modules/;
load_module modules/;

user ec2-user ec2-user;

worker_processes 1;

events {
    worker_connections 1024;

http {
    include        mime.types;
    default_type    application/octet-stream;

    sendfile        on;
    keepalive_timeout    65;
    gzip    on;

    server {
        listen 80;

                location / {

} ## End http
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the nginx mailing list