Introduction:
Recently I received a 502 Bad Gateway error when trying to access the SDDC Manager UI. This happened after Upgrading our VCF Environment from 4.5.0 to 5.1.1

After going through multiple troubleshooting steps, here is what I have done to resolve this issue.
Troubleshooting:
First things first, please check the volumes on your SDDC Appliance.
SSH into the appliance using the user vcf and then root and use the following command
#df -h

The above screenshot shows the output to check all the volumes on the sddc manager appliance.
In this case, the /data volume is at 100% capacity and that was causing the UI not to load. So, I dug a little deeper into this volume to see what was occupying all the space in it and found this file which is occupying it.

Resolution:
After investigating the data volume, I did some research on the volume being full and found the following kb article from Broadcom, KB311989 which shows the way to increase the capacity of the /data partition and then to reboot the appliance to get it working.
I followed the steps in the KB article and once I increased the /data volume and rebooted the sddc manager, all the services came back up in the SDDC Manager and its UI was up.
Conclusion:
The issue was with the /data volume being full. Once we increased the capacity of this volume from the above KB, the UI Issue resolved itself.
Hope this article helps.