I host my eCommerce site with WP Engine. Recently customers have been complaining of a 502 Error page when they go to the Cart or Checkout pages. This tends to only happen if a customer isn’t logged in. I did some research online and found other users encountering a similar problem caused by caching so WP Engine has set the cart & checkout pages to not be cached. The problem is still happening though and I’m not sure where to turn, our company is losing money because of this. We’ve updated everything to be current (WordPress, Theme, WooCommerce, Plugins). WP Engine support looked at the error logs and found that the last file opened before the 502 error occurs is:
Sorry, but 502 error is related to server configuration, not to the theme.
Also as you can see the file wp-content/plugins/woocommerce/templates/checkout/payment-method.php is related to Woocommerce plugin.
You have to investigate this issue with your hosting provider or move to another server.