Need help with configuration of Trusted_Proxies

Hello,

After having my server’s database die on me, and rebuilding my server from scratch, I’m running into a strange issue with my reverse proxy config.

Here’s the setup:

Nextcloud Server: Ubuntu 24.04 LTS, NC Version 30.0.4
Reverse Proxy: Arch Linux - Nginx Reverse Proxy 1.26.2
Cloudflare Proxy

Here’s my snippet of my config.php file:

  'trusted_domains' =>
  array (
    0 => 'localhost',
    1 => '[Omitted - IP of NextCloud server]',
    2 => '[Omitted - hostname of server]',
    3 => 'cloud.xylerfox.ca',
  ),
  'trusted_proxies' =>
  array (
    0 => '[Omitted - IP of Nginx Reverse Proxy Server]',
    1 => '173.245.48.0/20',
    2 => '103.21.244.0/22',
    3 => '103.22.200.0/22',
    4 => '103.31.4.0/22',
    5 => '141.101.64.0/18',
    6 => '108.162.192.0/18',
    7 => '190.93.240.0/20',
    8 => '188.114.96.0/20',
    9 => '197.234.240.0/22',
    10 => '198.41.128.0/17',
    11 => '162.158.0.0/15',
    12 => '104.16.0.0/13',
    13 => '104.24.0.0/14',
    14 => '172.64.0.0/13',
    15 => '131.0.72.0/22',
    16 => '[Omitted - My Public IP Address]',
  ),

  'forwarded_for_headers' =>
  array (
    0 => 'HTTP_X_FORWARDED_FOR',
  ),
  'version' => '30.0.4.1',
  'overwrite.cli.url' => 'https://cloud.xylerfox.ca',
  'overwritehost' => 'cloud.xylerfox.ca',
  'overwriteprotocol' => 'https',

here’s where I’m getting stuck at. With this config, my NextCloud yells at me that the Reverse Proxy isn’t set up properly. It keeps throttling my reverse proxy server.

If I remove my public IP from the trusted proxies, it seems to work, but it registers all incoming IP as my public IP address. Despite me using my internal DNS to bypass going to the Internet, so it should be showing my internal address.

I had this all working before I had to rebuild my entire server. This is the biggest frustrating part. I’m unsure what I’m missing from all this…

@Xylerfox

see Hosts & FQDN configuration… it’ll be similar for your install.

Hello,

Thank you for the link, though I don’t think it matches since I didn’t use the Snap install. I used the NextCloud VM Script to install.

Although, I might have been just frustrated over the day’s events and couldn’t see clearly. It is working well. I believe it’s the Arch based Reverse proxy that is showing my outside IP instead of my internal one when accessing it directly. No idea why it’s doing that, but I tried it from my phone on 5G and it showed me the correct outside IP. Strange, but nothing I’ll lose sleep over. As long as it works well, that’s all that matters :slight_smile:

Thanks for your time!

1 Like

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