How to access an NGINX server page from an AWS Ubuntu instance over the internet?

Asked

Viewed 472 times

1

I just created an instance of Ubuntu in AWS and installed NGINX as a server. Everything seems to be right:

root@ip-172-31-8-234:/home/ubuntu# netstat -ntlp
Active Internet connections (only servers)
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      11856/nginx -g daem
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1328/sshd
tcp6       0      0 :::80                   :::*                    LISTEN      11856/nginx -g daem
tcp6       0      0 :::22                   :::*                    LISTEN      1328/sshd

And this is the homepage of the NGINX server:

ubuntu@ip-172-31-8-234:~$ curl localhost
<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
<style>
    body {
        width: 35em;
        margin: 0 auto;
        font-family: Tahoma, Verdana, Arial, sans-serif;
    }
</style>
</head>
<body>
<h1>Welcome to nginx!</h1>
<p>If you see this page, the nginx web server is successfully installed and
working. Further configuration is required.</p>

<p>For online documentation and support please refer to
<a href="http://nginx.org/">nginx.org</a>.<br/>
Commercial support is available at
<a href="http://nginx.com/">nginx.com</a>.</p>

<p><em>Thank you for using nginx.</em></p>
</body>
</html>

I am accessing through SSH - Putty.

When I try to access by browser, on the internet I get an error:

This site can’t be reached

54.94.152.233 took too long to respond.

These are the instance settings in AWS:

Public DNS (IPv4) - ec2-54-94-152-233.sa-east-1.compute.amazonaws.com
Instance state - running
IPv4 Public IP - 54.94.152.233

I’m not getting access to the Welcome page of NGINX from the internet. What am I doing wrong? Is some configuration missing from AWS?

  • One question: have you released port 80 in the security group inbound instance? It comes by default not accessible.

  • worked. Publish your answer.

  • published the answer!

1 answer

3


You must release door 80 on Security Group of the Instance, which by default is inaccessible.

On the tab Inbound, only add the corresponding rule: if you put HTTP in the Type, he already fills the field with door 80.

Source 0.0.0.0 opens for everyone. Or you can fill in your IP for only you access (there is a helper there My IP that fills with your IP).

Browser other questions tagged

You are not signed in. Login or sign up in order to post.