[artix-general] [Forum] Cloudflare configuration

jmjl jmjl at su.tilde.green
Tue Mar 28 19:08:16 CEST 2023


Because else the forum thinks Cloudflare is a user, and when forum
admins try to ban by IP, they ban Cloudflare's IP.
On Tue Mar 28, 2023 at 5:38 PM CEST, Ruben Safir wrote:
> why?
>
>
> On Sun, Mar 26, 2023 at 06:59:14AM +0200, jmjl wrote:
> > 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.
> > -- 
> > artix-general mailing list
> > artix-general at artixlinux.org
> > https://lists.artixlinux.org/listinfo/artix-general
>
> -- 
> So many immigrant groups have swept through our town
> that Brooklyn, like Atlantis, reaches mythological
> proportions in the mind of the world - RI Safir 1998
> http://www.mrbrklyn.com 
>
> DRM is THEFT - We are the STAKEHOLDERS - RI Safir 2002
> http://www.nylxs.com - Leadership Development in Free Software
> http://www2.mrbrklyn.com/resources - Unpublished Archive 
> http://www.coinhangout.com - coins!
> http://www.brooklyn-living.com 
>
> Being so tracked is for FARM ANIMALS and extermination camps, 
> but incompatible with living as a free human being. -RI Safir 2013



More information about the artix-general mailing list