I am using Nextcloud 11 on Ubuntu 16.04. My setup is the default image at https://github.com/indiehosters/nextcloud.
With this setup, nginx runs in a container for managing all the nextcloud-specific settings. Outside of the container, I have nginx as a load balancer/proxy.
In order to set up fail2ban, I have to pass it client’s IP addresses from nextcloud.log. The problem is, the IP is always the same:
“remoteAddr”:“172.18.0.1”,“app”:“core”,“message”:“Login failed: ‘username’ (Remote IP: ‘172.18.0.1’)”,
This is the IP address of my nginx container, I believe. How do I tell it to use the actual client’s IP instead? (I have already added X-Forwarded-For proxy headers).
Previously, I had an old Owncloud setup with Apache where this worked. the log message would include “X-Forwarded-For: ‘’”. Is it possible to get that behavior with Nextcloud/nginx? If so, how?