Correct config for Trusted Proxys

I cannot resolve the “trusted_proxies“ setting is not correctly set, it should be an array of IP addresses error in the Admin Overview.

The community help forum (help.nextcloud.com) is for home and non-enterprise users. Support is provided by other community members on a best effort / “as available” basis. All of those responding are volunteering their time to help you.

If you’re using Nextcloud in a business/critical setting, paid and SLA-based support services can be accessed via portal.nextcloud.com where Nextcloud engineers can help ensure your business keeps running smoothly.

Getting help

In order to help you as efficiently (and quickly!) as possible, please fill in as much of the below requested information as you can.

Before clicking submit: Please check if your query is already addressed via the following resources:

(Utilizing these existing resources is typically faster. It also helps reduce the load on our generous volunteers while elevating the signal to noise ratio of the forums otherwise arising from the same queries being posted repeatedly).

Nextcloud Server version: Nextcloud Hub 10 (31.0.11)

Operating system and version Ubuntu 24.04

Web server - NGINX

Reverse proxy and version - NGINX

PHP version 8.3

Is this the first time you’ve seen this error? No: This is a fresh installation and was immediately present

Installation method : Docker AIO

Are you using CloudfIare, mod_security, or similar?

Summary of the issue you are facing:

I cannot resolve the “trusted_proxies“ setting is not correctly set, it should be an array of IP addresses error in the Admin Overview.

This is the array in my config.php file, why does it not work?

‘trusted_domains’ => [‘localhost’,‘cloud.shearer.au’],
‘trusted_proxies’ => [‘127.0.0.1’,‘172.19.0.1’],
‘forwarded_for_headers’ => [‘HTTP_X_FORWARDED_FOR’,‘HTTP_X_REAL_IP’],
‘overwritehost’ => ‘cloud.shearer.au’,
‘overwriteprotocol’ => ‘https’,
‘overwrite.cli.url’ => ‘https://cloud.shearer.au’,

Cerbot certificates are all installed and valid.

Captain ChatGPT has been unable to resolve either

Thank you for you help

Hey @Andy_AU welcome to the Nextcloud community :waving_hand:

Trusted proxy configuration

When you’re running Nextcloud behind a proxy it needs to know about the proxy.

Set trusted proxies (iterating values 0, 1, 2…):

occ config:system:set trusted_proxies 0 --value="your.reverse.proxy.ip"
occ config:system:set trusted_proxies 1 --value="your.other.proxy.ip"
occ config:system:set trusted_proxies 2 --value="another.reverse.proxy.ip"

your array should look something like this:

  'trusted_proxies' => 
  array (
    0 => 'your.reverse.proxy.ip',
    1 => 'your.other.proxy.ip',
    2 => 'another.reverse.proxy.ip',
   ),
1 Like

Can you provide more context? Are you attempting to customize trusted_proxies?

You may want to check the fully parsed (and non-censored) output by running occ config:list system --private. And perhaps posting the censored version if still stuck (occ config:list system).

Since you mentioned AIO, are you perhaps using podman rather than Docker? "trusted_proxies" setting is not correctly set · Issue #5221 · nextcloud/all-in-one · GitHub

The Nextcloud Admin Manual has fairly extensive coverage of the config file format.