英文:
Can I connect internal alb to private route 53 and proceed with SSL authentication?
问题
请将面向互联网的负载均衡器放在公共区域,并将其发送到React。然后React调用与内部ALB相连的后端。换句话说,前端可以调用内部ALB。通过将内部ALB的地址应用于私有路由53,可以创建'example.local'。我尝试在React中连接它,但它被发送为HTTP请求,而React主页是HTTPS的,导致混合内容错误。有解决这个问题的方法吗?
后端和前端通过ECS目标服务于不同的集群。
英文:
Place the internet facing load balancer in the public area and it is sent to React. Then react calls the backend connected to the internal alb. In other words, internal alb can be called in frontend. And by applying the address of internal alb to private route 53, 'example.local' could be created. And I tried to connect this in react, but it was sent as an http request, and the react homepage was in https, causing a mixed content error.
Is there a way to solve this?
Backend and frontend are serviced by different clusters through ecs target.
答案1
得分: 0
如果您遇到混合内容错误,那意味着您的请求来自Web浏览器,而不是后端服务器。由于您正在使用React,这是一个前端JavaScript框架,因此对后端的请求来自每个用户的笔记本电脑/台式电脑,而不是来自前端Web服务器。这意味着后端API不能位于内部负载均衡器后面,因为这样就无法从用户的Web浏览器中访问它。
英文:
If you are getting a mixed content error, then that means your requests to the backend are coming from the web browser, not a back-end server. Since you are using React, which is a front-end JavaScript framework, requests to your backend are coming from each user's laptop/desktop computer, not from your front-end web server. This means the backend API cannot be behind an internal load balancer, because then it wouldn't be accessible from the user's web browser.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论