2 nextcloud/certificates behind SWAG docker

2 nextcloud/certificates behind SWAG docker

Hello

I have a problem to configure nginx with two different domains.
I can’t find my problem so I’m going to explain my installation to you chronologically.
I installed docker swag/fail2ban/Dashboard with a first Nextcloud on a duckdns domain and letsencrypt certificate generate in my swag stack. all go well.
I bought another domain on OVH and I used certbot in console mode from portainer to generate my other letsencrypt certificate. I have two directories in /etc/letsencrypt/live/
one xxx.duckdns.org and another yyyy.fr
I managed to display my site yyyy.fr but without the https. I modified my yyy_subdomain.conf to add just after the include /config/nginx/ssl.conf; :
ssl_certificate /etc/letsencrypt/live/yyyy.fr/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/yyyy.fr/privkey.pem;

So I succeeded afterwards in displaying https://yyyy.fr but I now have a systematic redirection from https://xxx.duckdns.org to https://yyyy.fr

I then duplicate my two ssl.conf to have two other ssl_xxx_duckdns_org.conf and ssl_yyyy_fr.conf
I modified my two yyy_subdomain.conf and xxx_subdomain.conf to point the include /config/nginx/ssl_xxx_duckdns_org.conf; and include /config/nginx/ssl_yyyy_fr.conf;
But I still have the same redirect on my two Nextcloud instances.
I wonder if it’s not a problem with the Fastcgi cache?
If anyone has an idea I’m a taker.
Thanks in advance.

I am progressing on the identification of my problem.
My redirection comes from my config.php of the site yyyy.fr
in the trusted proxies tag.
I can’t manage my two certificates so as not to have an access attempt error page by a bad domain.
By putting in config.php of yyyy.fr the following lines I no longer have the problem but I have the permanent redirection:
‘trusted_proxies’ =>
array (
0 => ‘swag’,
),
‘overwrite.cli.url’ => ‘https://yyyy.fr/’,
‘overwritehost’ => ‘yyyy.fr’,
‘overwriteprotocol’ => ‘https’,
0 =>
array (
0 => ‘yyyy.fr’,
),

Initially I just had:

‘trusted_proxies’=>
array (
0 => ‘xxx.duckdns.org’,
)

and the same for yyyy.fr
but i had domain problem.

How to solve this kind of problem please.