20

I'm trying to figure out how to set up Nginx on a micro-instance on AWS.

The micro-instance is set up and running. I've associated an elastic IP to it. I SSH into it, make a new user run apt-get upgrade, then apt-get install nginx. Nginx gets installed. Then I run sudo service nginx start. It looks like nginx is started. I can see the workers as running processes.

So I try to access the server through the public IP ie. elastic IP via my browser in hope of seeing the 'Welcome to Nginx' screen. But all I get is the message that the server can't be found.

I'm clueless on how to continue.

Jonathan
  • 7,488
  • 7
  • 46
  • 63

1 Answers1

24

To verify that the problem isn't with the server, try running a wget http://localhost/ from your instance and see if you get the page you're expecting. If you do, it's probably firewall related.

When you created your instance, you had to provide a security key (this is what you use to ssh into it) and a security group.

You need to make sure that your security group has port 80 open (assuming you have nginx configured on port 80).

If you have a new AWS account, and you're running your instance inside a VPC, you need to make sure your VPC has an internet gateway attached.

chris
  • 33,326
  • 50
  • 148
  • 232
  • 1
    Rejoice! That did it. StackOverflow helped also helped me with [Opening port 80](http://stackoverflow.com/questions/5004159/opening-port-80-ec2-amazon-web-services) – Jonathan Jan 09 '14 at 20:53
  • 1
    Was lost until I found the Opening port 80 hint!! thanks guys – marman Jun 05 '15 at 00:34
  • 1
    Adding a TCP inbound rule for port 80 in security group helped! – zkytony Jan 05 '16 at 16:58