Redirect loop issues

Hi,

I am trying to troubleshoot an issue which is present on two different sites I have created in EE4.

Both sites are created with the www subdomain just like the sites I am trying to migrate. Initially they work fine to run the backup-installer script but once the content is imported, I get a redirect loop which I seem unable to troubleshoot. The content is imported using Duplicator in the case of a Wordpress site and using Akeeba Backup in the case of a Joomla site created with --type=php

When reading the nginx logs for the sites, I notice there is a 303 redirect from www.[site].com back to www.[site].com. Using error_log path debug in the .conf files doesn’t seem to give me more information on the issue. All the redirects I see in the conf files are 301…

Has anyone else had a similar issue? Any feedback to help troubleshoot this? Thanks

After many site create/delete cycles, I have been able to get rid of the redirection issues on the Wordpress site. I wish I was able to say what caused it…

Regarding the Joomla site created with --type=php, the issue remains. What I have discovered is that the force_ssl configuration was creating the redirect. It seems like the site is not aware it is already being served through https by nginx-proxy. The nginx $https flag is missing.

I am still looking at how to forward the flag to the nginx container

Issue is resolved. An additional check which is added automatically to WP sites had to be added to my php site per @paramdeo in EE V4 Cloudflare Flexible SSL not working

if ( isset( $_SERVER['HTTP_X_FORWARDED_PROTO'] ) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')
        $_SERVER['HTTPS']='on';