Problem 302 redirect Truenas scale + Nginx


I have a truenas scale 22.02.4 + Nextcloud 24.05 And I want to use it behind a Nginx proxy manager 2.9.18 .

I have created my Nginx proxy host verry easly with the GUI like this :


I set the config.php for Nextcloud like this :

 'overwritehost' => 'cloud.*******.fr:443',
  'overwriteprotocol' => 'https',
  'trusted_proxies' =>
  array (
    0 => '',
    1 => '',
    2 => '',

Problem is, when I access to the url https://cloud.******.fr, I can see a 302 redirection to the /login page whith the nextcloud port instead the HTTPS port used by nginx.


I don’t understand if it is a problem of nginx not rewrinting url or nextcloud not using the “overwritehost” confguration. By the way if I set “overwritehost” whith a fake url it doesn’t seem to be used by the app.

Any Idea ?