Cloudflare很happy的为大家开发了这个模块,改改就可以用了。
wget https://www.cloudflare.com/static/misc/mod_cloudflare/mod_cloudflare.c
以下配置适用于国内各大CDN加速服务
#define CF_DEFAULT_IP_HEADER “X-Forwarded-For”
#define CF_DEFAULT_TRUSTED_PROXY {“119.188.14.0/24″,”119.188.132.0/24″,”61.155.149.0/24″,”61.182.137.0/24″,”222.216.190.0/24″,”183.60.235.0/24″,”117.34.28.0/24″,”119.167.246.0/24″,”42.236.7.0/24″,”183.61.236.0/24″,”117.27.149.0/24″,”59.51.81.0/24”}
#define CF_DEFAULT_TRUSTED_PROXY_COUNT 12
/usr/local/httpd/bin/apxs -a -i -c mod_cloudflare.c