REST端点正在转换为公共IPv4

时间:2018-12-11 01:30:52

标签: amazon-web-services cors

上周前,我有一个Angular单页应用程序(SPA),该应用程序托管在AWS S3上。 SPA指向端口8080上的EC2实例上用Spring编写的REST API。它运行正常,没有问题。

这周,我注册了一个域,并决定将SPA移至同一EC2实例。整个设置是Dockerized。 https-portal用于自动更新Let's Encrypt证书,并将流量从端口80/443重定向到nginx容器-该容器为我的SPA服务。

我已经重建了SPA,以使用domain.com:8080作为端点。当我访问域时,将提供SPA。但是,当我尝试使用SPA时,会出现以下错误(Mozilla Firefox):

Blocked loading mixed active content “http://<IP address>/v1/api/user/login”

由于某种原因,domain.com:8080被转换为EC2的公共IPv4。

我禁用了Firefox保护,然后再次尝试了SPA。这次,出现以下错误:

Loading mixed (insecure) active content “http://<IP address>/v1/api/user/login” on a secure page[Learn More] polyfills.56ff5817334167e8d717.js:1:37852
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://<IP address>/v1/api/user/login. (Reason: CORS request did not succeed).[Learn More]

我抬起error in particular,但似乎无法弄清楚它为什么会发生。不幸的是,由于该网站与工作相关,因此我无法提供该网站。

为什么将domain.com:8080转换为http://<IP address>

0 个答案:

没有答案