Nextcloud trusted proxies

what did you put in config.php to prevent the error The reverse proxy header configuration is incorrect, or you are accessing Nextcloud from a trusted proxy ?
I’ve tried with the apache image , the nginx web server and now with caddy web server.
They all run in a pod behind a seperate caddy reverse proxy.

so I can only conclude that its an issue with my config.php

this is the relevant bit of my config.php

  'trusted_domains' => 
  array (
    0 => '',
    1 => '',
  'trusted_proxies' => '',
  'datadirectory' => '/var/www/html/data',
  'dbtype' => 'mysql',
  'version' => '',
  'overwrite.cli.url' => '',
  'overwriteprotocol' => 'https',

my reverse proxy caddyfile looks like this {
        encode gzip

        header Strict-Transport-Security max-age=15552000;

I use the addresss because I have caddy cofigured with --net slirp4netns:allow_host_loopback=true,port_handler=slirp4netns instead of --network=host

strangely my nextcloud shows the al the request in the log coming from localhost -  22/Mar/2023:17:50:14 +0000 "GET /ocs/v2.php" 304 -  22/Mar/2023:17:50:44 +0000 "GET /ocs/v2.php" 304 -  22/Mar/2023:17:51:43 +0000 "PUT /ocs/v2.php" 200

I assume this is because it sees only requests from the caddy webserver.

This should be an array of IP addresses, not a string URL. See the Nextcloud docs Reverse proxy — Nextcloud latest Administration Manual latest documentation

Try this:

'trusted_proxies' => [''],
1 Like

I cant believe it , I’ve been struggling with that for days now and it was a simple as that. Thank you so much for your help

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