我该如何在我的公共领域对AWS Lightsail Docker容器进行get请求

发布于 2025-02-04 13:21:06 字数 552 浏览 3 评论 0原文

我有一个链接下面分配给我当前的Aws Lightsail Docker容器,例如:

https:// project-name .xxxxxxxxxxxxxxxxxxxxxxxx x.us-west-west-west-west-cs.cs.amazonlightsail.com/

我允许在Docker Blask API和AWS Lightsail容器上启用端口5000。 我想在端口5000上执行get请求,以从某个子域请求数据。

我打电话给本地主机API的方式是通过 127.0.0.1:5000/subject/number

因此,我认为我将API公共领域称为这样:

https:// project-name .xxxxxxxxxxxxxxxxx。 us-west-2.cs.amazonlightsail.com:5000/subject/number

我把港口和子域放在AWS域的正确位置吗?

I have a link below that was assigned to my current AWS lightsail Docker Container such as:

https://project-name.xxxxxxxxxxxxx.us-west-2.cs.amazonlightsail.com/

I allowed port 5000 to be enabled on my docker flask api and on my AWS lightsail container.
I want to do a GET Request on port 5000 to request the data from a certain subdomain.

The way I called the local host api was through
127.0.0.1:5000/subject/number

Therefore I was thinking I would call the API Public Domain like this:

https://project-name.xxxxxxxxxxxxx.us-west-2.cs.amazonlightsail.com:5000/subject/number

Am I putting the port and subdomain in the correct place for the AWS domain?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

丿*梦醉红颜 2025-02-11 13:21:06

是的,您做得正确。在我看来,如果它不起作用,它与URL无关,而与您的安全规则无关。确保您已公开暴露的端口5000。

Yes, You are doing it correctly. It seems to me that if it is not working, it has nothing to do with the url, but rather with your security rules. Make sure you have publicly exposed port 5000.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文