Operating system and version (e.g., Ubuntu 24.04):
Debian 12
Web server and version (e.g, Apache 2.4.25):
Apache/2.4.63
Reverse proxy and version _(e.g. nginx 1.27.2)
replace me
PHP version (e.g, 8.3):
8.3.21
Is this the first time you’ve seen this error? (Yes / No):
Yes
When did this problem seem to first start?
After configuring trusted_proxies with my reverse proxy’s IP
Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
Nextcloud AIO 11.0
Are you using CloudfIare, mod_security, or similar? (Yes / No)
No
Summary of the issue you are facing:
/settings/admin/security and that logs are showing my remote IP as 127.0.0.1 leading to some throttling.
Before it showed the Tailnet IP of my reverse proxy, so I configured trusted_proxies 2 to include that IP per ip.address.that.is.shown in the all-in-one issue#2045:
I don’t think Caddy is misconfigured because my Jellyfin server uses the same reverse proxy and detects the client IP correctly.
Is there something to configure in Apache to debug this further? I can’t edit the config file there because it’s on a read-only filesystem in Nextcloud AIO
Steps to replicate it (hint: details matter!):
Log entries
Nextcloud
Example log entry showing the wrong remote IP
Web server / Reverse Proxy
Reverse proxy detects the remote_ip correctly:
The output of your Apache/nginx/system log in /var/log/____: docker log nextcloud-aio-apache:
I’m not sure how to get the access logs of the AIO Apache with headers. If anyone knows that would help debug things.
I think I figured out the problem. Nextcloud AIO has its own Caddy in the nextcloud-aio-apache container that acts as a reverse proxy to all the Nextcloud servers within the docker network. That Caddy has its trusted_proxies configured independently from the Nextcloud configuration in all-in-one/Containers/apache/start.sh
I was able to use the shell in nextcloud-aio-apache to modify the Caddyfile to include my reverse proxy’s internal IP, reload that config, and see that the problem goes away.
I think that when the reverse proxy is running on a different server, we need a way to configure trusted_proxies for both Nextcloud server and the nextcloud-aio-apache Caddy instance. Alternatively, I can insert another reverse proxy into the same docker network that trusts my reverse proxy’s IP into the chain, but I don’t like that solution much.
@jtr thanks for the pointer about the old Caddy. It is the default in the Debian 12 bookworm repository and isn’t even going to be upgraded much in Debian 13! I will look into upgrading it.
To reiterate a bit. My topology is on a different server from the reverse-proxy documentation.