- haproxy镜像版本为1.9
- nextcloud镜像版本 26
修改haproxy配置文件
在配置中增加
option forwardfor
然后重新启动haproxy
修改nextcloud配置文件
修改/etc/apache2/conf-enabled下的remoteip.conf文件
原文件为
RemoteIPHeader X-Real-IP
RemoteIPTrustedProxy 10.0.0.0/8
RemoteIPTrustedProxy 172.16.0.0/12
RemoteIPTrustedProxy 192.168.0.0/16
修改为
RemoteIPHeader X-Forwarded-For 修改这里
RemoteIPTrustedProxy 172.18.5.0/24 增加一行 自己代理的ip地址段
RemoteIPTrustedProxy 10.0.0.0/8
RemoteIPTrustedProxy 172.16.0.0/12
RemoteIPTrustedProxy 192.168.0.0/16
重新启动服务即可