curl connection refused

Joel Parker joel.parker.gm at gmail.com
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 0.0.0.0:80              0.0.0.0:*
LISTEN      1114/nginx: master

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

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

curl http://172.31.22.230/
curl: (7) Failed to connect to 172.31.22.228 port 80: Connection refused

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

Here is the config:

# cat nginx.conf
load_module modules/ndk_http_module.so;
load_module modules/ngx_http_lua_module.so;

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 / {
            proxy_pass http://18.220.148.14;
        }
    }

} ## End http
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20171218/3b21b4af/attachment.html>


More information about the nginx mailing list