502 Bad Gateway, only when going through Cloudflare

So, you are proxying 8081 to 80.
May I also ask, running ISPConfig on 8081 port or some other app? - as it could may be configured to one of the supported and compatible ports with Cloudflare proxy mode :orange:.

Therfore, I would recommend using the one of the available, which works over HTTPS and you do not need to proxy it over the other port, rather keep using it over for example 2083, 2096, etc. with the SSL :wink:

In case you do not have an SSL certificate, you can use Cloudflare SSL, if so, kindly make sure you follow the instructions as follows on the below article to setup an SSL certificate using Cloudflare Origin CA Certificate:

May I ask what SSL option have you got selected under the SSL/TLS tab at Cloudflare dashboard for your domain ( Flexible, Full, Full Strict … )?

And seems to me you are running unsecured (HTTP) connection, correct?
Are you planning to go on HTTPS or not?

May I also ask, www or non-www?

Here is a way to re-check if you correctly setup the SSL for your domain with Cloudflare:

Last but not least, kindly have a look here for more information regarding correct SSL settings at the SSL/TLS tab on Cloudflare dashboard:

In terms of a 502 error, may I suggest looking at the below article:

Furthermore, do not skip below step and kindly re-check if Cloudflare is allowed to connect to your origin host to as follows in the below article:

Nevertheless, Cloudflare IP addresses list can be found here:

1 Like