I am getting a 502 gateway error

Getting 502 gateway when trying to checkout:

Error 502 - Bad Gateway
Whoops, something went wrong at our end!
Please try again later or contact us if the problem persists.

Disabled all the plugins except WooCommerce, and cleared the Object cache, but the issue still exists.

Please advise what’s causing the issue.