502 Bad Gateway

The HTTP 502 status code means a proxy server (also known as gateway) didn’t receive a valid response from the upstream server (also known as an origin server).

Having a proxy server in front of the application (upstream) server is a common pattern in production web apps. Web servers (acting as reverse proxies) are more efficient in and capable of terminating TLS connections, dealing with slow clients, compressing requests, and serving static files quickly. Some popular open-source software used as proxies is Apache, Nginx, HAProxy, Varnish, and Caddy.

Make sure that upstream server:

Interested in no-nonsense technical guides?

No spyware, no promotional emails, or keyword-stuffed junk. I will only send you a single email when I've got something interesting to say. Unsubscribe anytime.

You can also subscribe to the Atom feed (it's like RSS, but better).