问题描述
我有一个运行Ubuntu的AWS EC2实例.
我有一个解析服务器,运行在本地主机的端口1337上.我已在实例的安全组中启用该端口.
I have an AWS EC2 Instance running Ubuntu.
I have a Parse server on it, running on localhost, port 1337. I've enabled that port in the instance's security group.
我尝试使用wget
命令检查是否以及如何访问实例的localhost
,并检查是否存在连接或连接被拒绝,结果如下:
I've tried to check if and how can I access to the instance's localhost
using the wget
command and check if there is a connection or the connection has been refused, and these are the results:
$ wget http://<Public IP>:1337/parse
Connecting to <Public IP>:1337... failed: Connection refused.
$ wget http://<Private IP>:1337/parse
Connecting to <Private IP>:1337... failed: Connection refused.
$ wget http://localhost:1337/parse
Resolving localhost (localhost)... 127.0.0.1
Connecting to localhost (localhost)|127.0.0.1|:1337... failed: Connection refused.
$ wget http://<Public DNS>:1337/parse
Resolving <Public DNS> (<Public DNS>)... <Private IP>
Connecting to <Public DNS> (<Public DNS>)|<Private IP>|:1337... failed: Connection refused.
正如您在上面看到的,我检查了公共IP,公共DNS和私有IP.
它总是说它失败是因为connection refused
以及由于某些原因,甚至本地主机也被服务器拒绝了.
As you can see above, I checked the Public IP, Public DNS and Private IP.
It always said it failed because that the connection refused
, and for some reason, even localhost is refused by the server.
如何使localhost
可从其内部网络外部访问并访问解析服务器?
How can I make the localhost
accessable from outside the internal network of it and access the Parse server?
推荐答案
我通过使用EC2实例的公共IP对其进行了解决,并且能够访问在其上运行的Parse服务器.
I solved it by using the public IP of the EC2 instance and the I was able to access the Parse server running on it.
这篇关于如何访问在AWS EC2 Ubuntu的localhost上运行的Parse Server?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!