【问题标题】:POST request not working in Google CloudPOST 请求在 Google Cloud 中不起作用
【发布时间】:2017-11-09 09:55:00
【问题描述】:

我在 Google Cloud (GAE) 上部署了 MEAN 应用。 POST 请求在本地工作,但不在云端工作。我需要做些什么,特别是为了让它在 GAE 上运行?

GET 工作正常。

谢谢。

当我被邮递员击中时收到的错误:

<html>
    <head>
        <title>502 Bad Gateway</title>
    </head>
    <body bgcolor="white">
        <center>
            <h1>502 Bad Gateway</h1>
        </center>
        <hr>
        <center>nginx</center>
    </body>
</html>
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->

没有在本地使用 NGINX,这就是它可能工作正常的原因。

【问题讨论】:

  • 哈!为什么糟糕的代码可以在本地正常工作?
  • 几个原因,错误的目录引用,版本控制等
  • 我的意思是应用程序在我的机器上本地运行,运行良好。将相同的应用程序部署到云后,它不会响应 POST 请求。不过,它确实会响应 GET 请求。
  • 我明白了;但是,我们仍然需要查看代码。我们需要缩小问题的范围以找到解决方案。

标签: node.js google-app-engine cloud


【解决方案1】:

你得到什么回应?

GAE 非常严格,在 POST 上需要 Content-Length。

【讨论】:

    【解决方案2】:

    我在 Heroku 上部署了相同的代码,它第一次运行。我确定在 GAE 上 NGINX 和 Node 之间存在一些配置问题,但我没有时间弄清楚其他人的问题。

    也许当谷歌云更成熟一点时,我会回来。

    【讨论】:

      猜你喜欢
      • 2021-01-30
      • 1970-01-01
      • 2017-07-04
      • 2018-12-25
      • 1970-01-01
      • 2016-03-27
      • 2017-01-05
      • 2016-11-05
      相关资源
      最近更新 更多