阅读背景:

在AWS上的新微实例上设置Nginx

来源:互联网 

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

我正试图弄清楚如何在AWS上的微实例上设置Nginx。

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.

微实例已设置并运行。我已将弹性IP与其相关联。我通过它进入SSH,让新用户运行apt-get upgrade,然后运行apt-get install nginx。 Nginx已安装。然后我运行sudo服务nginx启动。看起来nginx已经启动了。我可以看到工人正在运行流程。

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.

所以我尝试通过公共IP访问服务器,即。通过我的浏览器弹性IP,希望看到'欢迎来到Nginx'屏幕。但我得到的是无法找到服务器的消息。

I'm clueless on how to continue.

我对如何继续无能为力。

1 个解决方案

#1


22  

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

要验证问题不在服务器上,请尝试从您的实例运行wget http:// localhost /,看看是否得到了您期望的页面。如果你这样做,它可能与防火墙有关。

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.

创建实例时,必须提供安全密钥(这是您用于ssh的安全密钥)和安全组。

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

您需要确保您的安全组已打开端口80(假设您在端口80上配置了nginx)。

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.

如果您有一个新的AWS账户,并且您在VPC内运行您的实例,则需要确保您的VPC连接了一个互联网网关。


分享到: