【问题标题】:Can't reach my spring boot app in aws instance在 aws 实例中无法访问我的 Spring Boot 应用程序
【发布时间】:2019-04-13 16:17:26
【问题描述】:

我是初学者,我已经在端口 8080 上的 aws 实例上启动了我的 Spring Boot 应用程序(使用 jar 文件)。但我无法通过显示“此站点可以”的浏览器 (PublicDNS:8080) 访问它无法联系 - 响应时间过长”。

我已允许从任何地方到我的服务器和端口 8080 的所有 http 和 https 流量。请帮助。

我的 AMI 中的 $curl http://localhost:8080 给出 StatusCode : 200。但是我本地机器中的 curl http://PublicDNS 给出了

curl : Unable to connect to the remote server
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : InvalidOperation: 
(System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebExc
 eption
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand

我在下面附上了我的安全组入站规则的屏幕截图

Security group inbound rules

提前谢谢你!

【问题讨论】:

    标签: amazon-web-services spring-boot amazon-ec2


    【解决方案1】:

    在您的 ec2 实例上尝试 $curl http://localhost:8080 [而不是 curl,您也可以使用 wget] 如果它工作正常;你知道你的弹簧靴很好,问题出在安全组。如果它不起作用;问题出在你的弹簧靴上。

    我觉得你的安全组看起来不错;这是你的弹簧靴的问题。

    【讨论】:

    • $curl localhost:8080 给出 StatusCode : 200。但是我本地机器上的 curl publicDNS 给出了 'curl : Unable to connect to the remote server' ,它会成功,但我已经使用了我的我本地机器上的spring boot应用程序,它运行良好,现在仍然如此。我不知道出了什么问题。
    猜你喜欢
    • 1970-01-01
    • 2021-06-22
    • 1970-01-01
    • 1970-01-01
    • 2021-12-03
    • 2016-07-03
    • 2020-03-12
    • 2017-04-19
    • 2018-02-15
    相关资源
    最近更新 更多