无法通过公共 ip 访问 EC2 实例上的站点 [英] Can't access site on EC2 instance via public ip

查看:33
本文介绍了无法通过公共 ip 访问 EC2 实例上的站点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经试用 EC2 几天了,并且一直反对甚至无法访问我托管的示例站点.堆栈是带有 Thin 和 Nginx 的 Rails 3.1.3.

I've been experimenting with EC2 for a couple days and have been banging my head against simply even being able to access the sample site I've hosted. The stack is Rails 3.1.3 with Thin and Nginx.

我尝试了几种不同的配置,最终运行了 Nginx 自动安装脚本,当我执行 curl http://ec2-107-20-143-179.compute-1.amazonaws.com/.但是,当我将浏览器指向那里时,它在说找不到页面之前永远挂起.

I've tried several different configurations and finally ended up running the Nginx auto install script, which does return a webpage when I do a curl http://ec2-107-20-143-179.compute-1.amazonaws.com/. However, when I point my browser there, it hangs forever before saying the page cannot be found.

我已经分配了一个弹性 IP 地址,并且我已经通过端口 80 启用了 HTTP 访问.

I have assigned an Elastic IP address, and I've enabled HTTP access via port 80.

我在系统管理员方面没有太多经验,在这一点上我基本上被难住了.任何建议将不胜感激.

I don't much experience with the sysadmin side and I'm basically stumped at this point. Any advice would be greatly appreciated.

推荐答案

您是否为所有 ip 启用了 http 端口?这将通过以下方式完成:

Did you enable the http port to all ips? That would be done by going to:

EC2 -> 安全组 -> 默认(或您的客户)-> 入站

EC2 -> Security Group -> Default (or your custome one) -> Inbound

然后为 HTTP 创建一个新规则,作为源,您应该分配:0.0.0.0/0

And then Create a new rule for HTTP and as a source, you should assign: 0.0.0.0/0

应该可以.

这篇关于无法通过公共 ip 访问 EC2 实例上的站点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆