Since Caddy 2.5.0 need to specify trusted_proxies to the wordpress caddyfile to get the CSS to load properly.
I added trusted_proxies private_ranges inside the phpfastcgi block, and it started working.
if ($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')
$_SERVER['HTTPS']='on';
at the beggining of the /usr/local/www/wordpress/wp-config.php according to this replacing the mydomain part with my custom url from the reverse proxy.
Since Caddy 2.5.0 need to specify trusted_proxies to the wordpress caddyfile to get the CSS to load properly. I added
trusted_proxies private_ranges
inside thephpfastcgi
block, and it started working.I also added (not sure if this was necessary.)
define('.COOKIE_DOMAIN.', 'www.mydomain.com'); define('.SITECOOKIEPATH.', '.');
if(isset($_SERVER['HTTP_X_FORWARDED_FOR'])) { $list = explode(',',$_SERVER['HTTP_X_FORWARDED_FOR']); $_SERVER['REMOTE_ADDR'] = $list[0]; } define( 'WP_HOME', 'https://www.mydomain.com' ); define( 'WP_SITEURL', 'https://www.mydomain.com' ); $_SERVER['HTTP_HOST'] = 'www.mydomain.com'; $_SERVER['REMOTE_ADDR'] = 'https://www.mydomain.com'; $_SERVER[ 'SERVER_ADDR' ] = 'www.mydomain.com';
if ($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') $_SERVER['HTTPS']='on';
at the beggining of the /usr/local/www/wordpress/wp-config.php according to this replacing the mydomain part with my custom url from the reverse proxy.