I would recommend to check with a tcpdump where the issue is. HTTP 502 responses are usually issue "upstream" so possibly the proxy your are using to access the UI of your MWG is having issues to access the UI, due to a firewall.
In this article you can find more infos on 502 cannot connect:
I would expect to see either Syn without response (packet drop on a firewall) then the error would appear after a time or if the error appears directly it is most probably RST (packet block on firewall).
However, a tcpdump should give you the necessary insight
I suppose you are going to the GUI through the proxy. Just connect the GUI directly.