Skip to content

Commit 12f21f9

Browse files
committed
added remoteip handling
Fixes: creativecommons/tech-support#112
1 parent 90ee8b6 commit 12f21f9

1 file changed

Lines changed: 34 additions & 5 deletions

File tree

config/creativecommons.org.conf

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,41 @@
1919
# modules, e.g.
2020
#LogLevel debug
2121

22+
RemoteIPHeader X-Forwarded-For
23+
# Cloudflare IPs
24+
# https://support.cloudflare.com/hc/en-us/articles/360029696071
25+
# IPv4: https://www.cloudflare.com/ips-v4
26+
RemoteIPTrustedProxy 173.245.48.0/20
27+
RemoteIPTrustedProxy 103.21.244.0/22
28+
RemoteIPTrustedProxy 103.22.200.0/22
29+
RemoteIPTrustedProxy 103.31.4.0/22
30+
RemoteIPTrustedProxy 141.101.64.0/18
31+
RemoteIPTrustedProxy 108.162.192.0/18
32+
RemoteIPTrustedProxy 190.93.240.0/20
33+
RemoteIPTrustedProxy 188.114.96.0/20
34+
RemoteIPTrustedProxy 197.234.240.0/22
35+
RemoteIPTrustedProxy 198.41.128.0/17
36+
RemoteIPTrustedProxy 162.158.0.0/15
37+
RemoteIPTrustedProxy 104.16.0.0/12
38+
RemoteIPTrustedProxy 172.64.0.0/13
39+
RemoteIPTrustedProxy 131.0.72.0/22
40+
# IPv6: https://www.cloudflare.com/ips-v6
41+
RemoteIPTrustedProxy 2400:cb00::/32
42+
RemoteIPTrustedProxy 2606:4700::/32
43+
RemoteIPTrustedProxy 2803:f800::/32
44+
RemoteIPTrustedProxy 2405:b500::/32
45+
RemoteIPTrustedProxy 2405:8100::/32
46+
RemoteIPTrustedProxy 2a06:98c0::/29
47+
RemoteIPTrustedProxy 2c0f:f248::/32
48+
# lb0.productionwww.creativecommons.uk0.bigv.io
49+
RemoteIPTrustedProxy 5.28.62.166/32
50+
# Local Varnish
51+
RemoteIPInternalProxy 127.0.0.1/32
52+
53+
LogFormat "%a %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" remoteip
54+
2255
ErrorLog ${APACHE_LOG_DIR}/error.log
23-
CustomLog ${APACHE_LOG_DIR}/access.log combined
56+
CustomLog ${APACHE_LOG_DIR}/access.log remoteip
2457

2558
# For most configuration files from conf-available/, which are
2659
# enabled or disabled at a global level, it is possible to
@@ -34,10 +67,6 @@
3467
Options +Indexes
3568
</Directory>
3669

37-
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
38-
SetEnvIf X-Forwarded-For "^.*\..*\..*\..*" forwarded
39-
CustomLog "/var/log/apache2/access.log" combined env=!forwarded
40-
4170
# We're proxied through varnish, so drop idle connections quickly
4271
KeepAlive Off
4372

0 commit comments

Comments
 (0)