502 Bad Gateway Error
This error indicates that the web server is trying to connect to another service in order to respond to your request but is unable to. A common scenario is web server software such as nginx, which does not incorporate a PHP interpreter, contacting a service such as php-fpm (typically running on the same server) in order to process PHP.

php-fpm might be unavailable because it is currently handling too many requests and has no free processes to handle your request. Or it is configured with too low a limit on the number of processes.

Alternatively if you access the web via a proxy server, the error might indicate that the proxy server is unable to contact the server where your site is hosted.

Does this error only occur on CiviCRM pages, can you access the rest of your site?

If you don't manage or have access to the server yourself, then best to contact your hosting provider.