axios.post 在本地向另一个应用程序发送 post 请求时,我的 VPS 出现错误。在我的本地计算机上一切正常

axios.post gives error on my VPS when sending post request locally to another app. Everything works fine on my local computer

所以我将 Nginx 配置为通过端口 433 (SSL) 将请求转发到 localhost:3000,其中反应是 运行ning,反应将依次 post 请求到 Node.js app 运行ning 在同一个 VPS (localhost:8080) 上进行条纹支付。

到目前为止一切正常。前端正在呈现,SSL 正在工作。

但是当我 运行 axios.post 使用来自 React 的支付数据时,它永远不会到达节点(据我的日志告诉我)。

我在节点中设置了 CORS 以接受一堆 "localhost" 变体和实际域本身。

为什么这不起作用? 谢谢!

我应该将 React 应用程序指向 api 的 Url,而不是它在我的 VPS 上的本地地址。抱歉。