Clouflare tunnel and HTTPS Wordpress

What is the name of the domain?

https://domain.ro/

What is the issue you’re encountering

Loop redirect

What steps have you taken to resolve the issue?

In wp-config.php I have

define(‘WP_HOME’, ‘https://domain.ro’);
define(‘WP_SITEURL’, ‘https://domain.ro’);

If I use http it works, not with https.

My understanding is, I have the domain in the tunnel settings point to http://192.168.0.156:8080, then Wordpress since it has WP_SITEURL to the domain redirects to the https domain, and then cloudflare redirects, stays in loop.

Works with http because cloudflare edge certificate, so when i go to https, tunnel sends to http://192.168.0.156:8080 and wordpress redirect to http, so it does not gen in the loop, my understanding.

What can be done so the site works with HTTPS as siteurl?

I solved it by adding in wp-config.php while keeping WP_SITEURL and WP_HOME to http.

$_SERVER['HTTPS'] = 'on';

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.