Here is a quick solution to fix the 502 bad gateway error on Zerodha Pi.
This normally happens when the backoffice servers are having heavy traffic.
To get rid of this error, First login to your kite account and then access the Q backoffice from there
Have a look at this screen shot for the Zerodha Q backoffice link on your Kite platform: