502 Bad Gateway with nginx | Google App Engine | Node JS

后端 未结 8 2409
时光取名叫无心
时光取名叫无心 2020-12-15 15:50

I am hosting the web app on Google Cloud Platform with App Engine and I am using ExpressJS and MongoDB, which is hosted on mLab.

Everything worked well until 1/1/201

相关标签:
8条回答
  • 2020-12-15 16:21

    check out the logs for any deployment errors

    $ gcloud app logs read
    

    I have came across a similar issue with the code provided by this tutorial (https://cloud.google.com/nodejs/getting-started/authenticate-users)

    And found there was a missing dependency. I fixed the missing dependency and the app is deployed and working fine.

    Details into the issue: https://github.com/GoogleCloudPlatform/nodejs-getting-started/issues/106

    0 讨论(0)
  • 2020-12-15 16:21

    I had the same problem with Express. What solved it for me was to not provide an IP address for the app.

    So my old code would be:

    var ip = "127.0.0.1";
    var port = "8080";
    var server = http.createServer(app);
    server.listen(port, ip);
    

    This would result in a 502 in app engine.

    Removing the ip was the solution for me.

    server.listen(port);
    
    0 讨论(0)
提交回复
热议问题