I’m running Nextcloud as a Snap on Ubuntu 24.04, behind a HAProxy which is running on the same system. My instance is accessible from LAN. It is listening on ports that are not the default HTTP and HTTPS ports. I have a custom certificate for the instance, signed by my own certificate authority. That is working, as I can access my instance at https://nextcloud.tld just fine.
I have 2 problems which I believe are caused by incorrect configuration. First problem is that every client is identified as 127.0.0.1. Second problem is that Nextcloud mobile clients (both Android and iOS) are unable to open office files (ods and odt) in the app for editing.
I’m running the built-in CODE-server. On the Nextcloud Office tab in the administration settings is the following error:
Failed to connect to the remote server: cURL error 60: SSL certificate problem: self signed certificate in certificate chain (see libcurl - Error Codes) for https://nextcloud.tld/extra-apps/richdocumentscode/proxy.php?req=/hosting/discovery
I’ve configured HAProxy exactly as described here with only changing the names, IP-addresses and ports to my own.
Here are some rows from the configuration file of the Nextcloud Snap that I believe are relevant to these problems.
'trusted_domains' => array (
0 => 'nextcloud.tld',
1 => 'localhost',
),
'trusted_proxies' => array (
0 => '127.0.0.1',
1 => '::1',
),
'forwarded_for_headers' => array (
0 => 'HTTP_X_FORWARDED_FOR',
1 => 'HTTP_X_REAL_IP',
),
'overwrite.cli.url' => 'https://nextcloud.tld',
What am I doing wrong?