502 Bad Gateway means that one server receives an invalid response from another server. The 502 code indicates many things like proxies, mistakes, or connections. In simple terms, when you want to view a page and if the web server cannot complete the request, then it is the cause of a 502 Bad Gateway. When your web browser fails to load the server, then it shows 502 Bad Gateway, Error 502, HTTP Error 502.
https://techyvibe.net/what-does-502-bad-gateway-mean/