IP地址127.0.0.1 Cors无法解析

时间:2020-09-10 18:15:38

标签: reactjs api express google-cloud-platform

enter image description here

我在Google云平台上拥有Web服务架构

如果我输入了domain(mydomain.com),它将前往负载均衡器 然后转到在计算引擎(虚拟机)上运行的nginx

在nginx中,代理表示127.0.0.1:3000,到目前为止一切正常。

127.0.0.1:3000调用了127.0.0.1:8000 api,并且此时发生了cors问题。

我确实将通配符(*)应用于cors,但是cors问题仍在进行中

enter image description here

enter image description here

我该如何解决?

1 个答案:

答案 0 :(得分:1)

在快递中,您应该将cors与特定的软件包集成在一起。 像这样

document.querySelectorAll('.text-medium').forEach((element, index) => {
   if (element.innerText.includes('New Construction :  No')) {
       element.style.display = 'none';
   }
})

https://expressjs.com/en/resources/middleware/cors.html

相关问题