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

后端 未结 8 2426
时光取名叫无心
时光取名叫无心 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

    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);
    

提交回复
热议问题