aws api gateway 白名单 reactjs 应用程序 IP 地址

huangapple go评论85阅读模式
英文:

aws api gateway whitelist reactjs app ip address

问题

It's possible to whitelist the IP address of a ReactJS website hosted on AWS ECS. Here are the translated parts:

  • 我已经将我的 API IP 地址添加到白名单中,它正在运行,我的 API 托管在 AWS ECS 容器中。
  • 我还将我的 ReactJS 网站托管在 AWS ECS 容器中,所以我将与我的集群连接的 EC2 实例添加到白名单中,我给它分配了一个弹性 IP 地址并将其添加到白名单中。
  • 我还将我的本地 IP 地址添加到白名单中,以便可以在本地测试我的 API,但是我的 ReactJS 网站完全不工作,当我尝试查看 ReactJS 使用的 IP 地址时,它输出了一个我不认识的 IP 地址。
  • 我将 ReactJS 网站部署到服务器上以查看是否可行,但仍然无法正常工作。

请问是否可以为网站的 IP 地址添加到白名单中?

英文:

Good day
Is it possible to Whitelist reactjs website ip address on aws API Gateway or any fron-end app .
I whitelisted my API ip address and it's working, my API is hosted in a container on aws ECS
I also hosted my Reactjs website in a container on aws ECS so I whitelisted the ec2 instance connected to my cluster I gave it an elastic Ip and whitelited it.

I also whitelisted my local Ip so that i can test locally my API is working but my reactjs website is not working at all and when I test to see which Ip address does reactjs uses it output an Ip I don't recognize.

I deployed the reactjs website to see if it will work on the server but still it does not work.

So I wanted to know if it is possible to whitelist a website's Ip.

Thanks in advance

答案1

得分: 1

抱歉,以下是翻译好的部分:

"No, it is not possible to whitelist the IP address of the application / server that is hosting the application. React applications are single page, and run in the browser of every single user. All of the code is run in, and all of the requests are made directly from, their browsers. For the react application to work with API Gateway, API Gateway would need to whitelist the IP address each user that is using the React application. Hope that helps!"

英文:

No, it is not possible to whitelist the IP address of the application / server that is hosting the application. React applications are single page, and run in the browser of every single user. All of the code is run in, and all of the requests are made directly from, their browsers. For the react application to work with API Gateway, API Gateway would need to whitelist the IP address each user that is using the React application. Hope that helps!

huangapple
  • 本文由 发表于 2023年4月17日 19:02:56
  • 转载请务必保留本文链接:https://go.coder-hub.com/76034448.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定