Hello dear artix server administrators, I have a few recommendations to
give out:
The forum seems to have a Ban IP feature, but as nginx or apache isn't
configured properly, the forum just bans Cloudflare.
I don't know how to do this in apache, but in nginx I know how. (The
following text maybe will help if apache is used as I don't know how to
configure it in apache)
The solution that I think you guys want is to make nginx or apache2
take the header `CF-Connecting-IP` and make that be the IP the forum
receives by setting it as the real IP. Nginx doesn't let us set a IP as
the real IP but it does let us set a header which is exactly what we
need, to get that done we'd do something like the following in nginx:
```
# IPv4
set_real_ip_from 103.21.244.0/22;
set_real_ip_from 103.22.200.0/22;
set_real_ip_from 103.31.4.0/22;
set_real_ip_from 104.16.0.0/12;
set_real_ip_from 108.162.192.0/18;
set_real_ip_from 131.0.72.0/22;
set_real_ip_from 141.101.64.0/18;
set_real_ip_from 162.158.0.0/15;
set_real_ip_from 172.64.0.0/13;
set_real_ip_from 173.245.48.0/20;
set_real_ip_from 188.114.96.0/20;
set_real_ip_from 190.93.240.0/20;
set_real_ip_from 197.234.240.0/22;
set_real_ip_from 198.41.128.0/17;
# IPv6
set_real_ip_from 2400:cb00::/32;
set_real_ip_from 2405:8100::/32;
set_real_ip_from 2405:b500::/32;
set_real_ip_from 2606:4700::/32;
set_real_ip_from 2803:f800::/32;
set_real_ip_from 2c0f:f248::/32;
set_real_ip_from 2a06:98c0::/29;
# Header
real_ip_header CF-Connecting-IP;
# (src: https://rdr-it.com/en/tips/nginx-get-the-visitors-real-ip-with-cloudflare/)
# (archived src:
# - http://web.archive.org/web/20230326045529/https://rdr-it.com/en/tips/nginx-get-the-visitors-real-ip-with-cloudflare/
# )
```
That snippet of code should be added inside the server block of each
site that uses Cloudflare proxying.
More information about the artix-general
mailing list