我按照此处的指南使用 Rust“Nickel”框架创建了一个简单的后端服务器:https://nickel-org.github.io/getting-started.html
我可以cargo run
在本地运行并通过邮递员访问本地端点http://127.0.0.1:6767
以获取此响应:
{
message: "Hello! Sincerely, Jimbob's Rusty Nickel"
}
这很棒,我想实时部署它。我正在使用带有 ubuntu 18.04 LTS 的微型 aws ec2 实例。安装 Cargo 并运行应用程序后,cargo run
我得到了通常的成功启动“等待请求”输出:
Listening on http://127.0.0.1:6767
Ctrl-C to shutdown server
我已使用以下设置打开服务器的端口:
入站:
80 tcp 0.0.0.0/0, ::/0
22 tcp 0.0.0.0/0
3000 tcp 0.0.0.0/0
443 tcp 0.0.0.0/0, ::/0
0-65535 tcp 0.0.0.0/0
6767 tcp 0.0.0.0/0
出站:
All All 0.0.0.0/0
6767 tcp 0.0.0.0/0
当我尝试使用带有端口 6767 的 ec2 公共 DNS(IPv4)或带有端口 6767 的 IPv4 公共 IP 调用实时端点时,收到此错误响应:
Could not get any response
There was an error connecting to http://3.83.65.51:6767.
Why this might have happened:
The server couldn't send a response:
Ensure that the backend is working properly
Self-signed SSL certificates are being blocked:
Fix this by turning off 'SSL certificate verification' in Settings > General
Proxy configured incorrectly
Ensure that proxy is configured correctly in Settings > Proxy
Request timeout:
Change request timeout in Settings > General