2016-10-18 86 views
0

我把一個rails 5應用程序放在一起,並試圖從AWS ec2實例運行它。我建立了我的安全組,但無法訪問我選擇的特殊端口。什麼可能是錯的?連接到AWS服務器時遇到問題

安全組設置:

Ports Protocol Source rails-dev-and-ssh 
80 tcp 72.21.xxx.0/24 ✔ 
22 tcp 72.21.xxx.0/24 ✔ 
3800 tcp 0.0.0.0/0 ✔ 

彪馬服務器啓動:

[[email protected] Viewer]$ rails server -p 3800 -b 172.31.42.206 
=> Booting Puma 
=> Rails 5.0.0.1 application starting in development on http://172.31.42.206:3800 
=> Run `rails server -h` for more startup options 
Puma starting in single mode... 
* Version 3.6.0 (ruby 2.3.0-p0), codename: Sleepy Sunday Serenity 
* Min threads: 5, max threads: 5 
* Environment: development 
* Listening on tcp://172.31.42.206:3800 
Use Ctrl-C to stop 

從相同的情況下,這兩個請求返回成功(軌版本和東西BLOB):

curl http://172.31.42.206:3800 <private IP> 
curl http://54.86.xxx.xx:3800 <public IP 

但從我的電腦不在EC2,我可以捲曲端口80沒有問題,但沒有端口3800,彪馬正在運行。這讓我相信我的AWS VPC配置是可以的,但Puma綁定的IP有問題。我也嘗試綁定到0.0.0.0。

$ curl http://54.86.xxx.xx/ <the public ip, port 80, succeeds> 
hi raj var www html 

$ curl http://54.86.xxx.xx:3800 
curl: (7) Failed to connect to 54.86.xxx.xx port 3800: Operation timed out 

回答

0

這不是AWS或rails ....這是我笨的辦公室防火牆,讓我無法訪問ec2中的任意端口。我可以通過手機訪問該網站。抱歉!