Hello,
Don't worry about minecraft.net error. "502/Bad Gateway" is a pretty standard error message for web server problems. It should go away. It's not related to you being unable to connect.
If you are connecting by IP, make sure to use localhost (127.0.0.1) instead of external IP. If you are playing through the Minecraft website, add "?override=true" to the end of the link, for example:
Code:
https://minecraft.net/classic/play/4e2d638e02bce8952714ea009bd0f5e7?override=true
There are also other Minecraft clients that handle connecting to local servers better, like
ClassiCube. Try that one.