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/2017. I had vm:true before and now was forced to change the env to flex. Now I am getting 502 bad gateway error with nginx. App engine doesn't allow us to change the nginx config file.
I had tried the suggestion from this post: Google App Engine 502 (Bad Gateway) with NodeJS but still doesn't work.
For some reason, I have another app with exactly the same setting on app engine and it works perfectly.
Any suggestion will be greatly appreciated. Thank you.
In more technical words, A 502 Bad Gateway means that the proxy (gateway) server wasn't able to get a valid or any response from the upstream server. If you are seeing a 502 bad gateway error on a website, it means that the origin server sent out an invalid response to another server that acted as a gateway or proxy.
If the error persists, there is a chance that your browser cache has saved outdated and corrupted files. In this case, clearing the browser cache can fix an HTTP 502 Bad Gateway error.
app should always listen to port 8080, google forwards all request from 80 to 8080 https://cloud.google.com/appengine/docs/flexible/custom-runtimes/build#listen_to_port_8080
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With