Nginx part:
check if your nginx has http_realip_module.use command nginux -V
[[email protected] ~] # nginx -V
nginx version: nginx/1.14.2
built by gcc 4.4.7 20120313 (Red Hat 4.4.7-23) (GCC)
built with OpenSSL 1.1.1a 20 Nov 2018
TLS SNI support enabled
configure arguments: --prefix=/usr/local/nginx --user=www --group=www --with-http_stub_status_module --with-http_v2_module --with-http_ssl_module --with-http_gzip_static_module --with-http_realip_module --with-http_flv_module --with-http_mp4_module --with-openssl=../openssl-1.1.1a --with-pcre=../pcre-8.42 --with-pcre-jit --with-ld-opt=-ljemalloc
add config into your nginx conf.
server {
listen 80 ;
server_name www.rockfuns.com;
location / {
#cdn server ip
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;
set_real_ip_from 199.27.128.0/21;
set_real_ip_from 2400:cb00::/32;
set_real_ip_from 2606:4700::/32;
set_real_ip_from 2803:f800::/32;
set_real_ip_from 2405:b500::/32;
set_real_ip_from 2405:8100::/32;
set_real_ip_from 2c0f:f248::/32;
set_real_ip_from 2a06:98c0::/29;
real_ip_header CF-Connecting-IP;
#your proxy config for apache
proxy_pass http://127.0.0.1:10000$request_uri;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
apache part:
get rpaf from github. web address is https://github.com/gnif/mod_rpaf/
use apxs to install mod_rpaf.if you don’t have apxs command.Use yum install httpd-devel
to get it.
#on apache 1.3: apxs -i -a -c mod_rpaf.c #on apache 2: apxs -i -c -n mod_rpaf.so mod_rpaf.c
Configuration Directives
RPAF_Enable (On|Off)
- Enable reverse proxy add forward
RPAF_ProxyIPs 127.0.0.1 10.0.0.0/24
- What IPs & bitmasked subnets to adjust requests for
RPAF_Header X-Forwarded-For
- The header to use for the real IP address.
RPAF_SetHostName (On|Off)
- Update vhost name so ServerName & ServerAlias work
RPAF_SetHTTPS (On|Off)
- Set the HTTPS environment variable to the header value contained in X-HTTPS, or X-Forwarded-HTTPS. For best results make sure that mod_ssl is NOT enabled.
RPAF_SetPort (On|Off)
- Set the server port to the header value contained in X-Port, or X-Forwarded-Port. (See Issue #12)
RPAF_ForbidIfNotProxy (On|Off)
- Option to forbid request if not from trusted RPAF_ProxyIPs; otherwise cannot be done with Allow/Deny after remote addr substitution
Example Configuration
LoadModule rpaf_module modules/mod_rpaf.so
RPAF_Enable On
RPAF_ProxyIPs 127.0.0.1 10.0.0.0/24
RPAF_SetHostName On
RPAF_SetHTTPS On
RPAF_SetPort On
RPAF_ForbidIfNotProxy Off
16 Comments
dirty keto diet
July 9, 2021 at 5:05 amketo diet health risks
what can you eat on keto diet
July 9, 2021 at 1:59 amketo reset diet
keto sauces
July 7, 2021 at 9:30 pmketo diet for dummies
dating sites free no subscription
June 26, 2021 at 5:03 amfree online dating site for 16-19 year olds
free dating local sites
June 24, 2021 at 5:24 pmlegitimate free dating sites
free dating and chating sites
June 24, 2021 at 2:58 ambest free dating sites in 1990
100 free dating sites reviews
June 23, 2021 at 7:49 pmsugar daddy dating sites free for women
dating in dubai free
June 2, 2021 at 9:08 amfree best dating sites
german dating sites for free
June 2, 2021 at 5:57 amshemale dating free
free lgbt dating
June 2, 2021 at 2:51 amuk free online dating
free dating sites on facebook
June 2, 2021 at 1:22 amsearch free dating site
free south american dating sites
May 20, 2021 at 8:50 pmgermany free dating sites
free french dating site
May 20, 2021 at 7:52 pm100 free dating site in united state of america
totally free canadian dating sites
May 20, 2021 at 6:17 pmfree online dating site for mobile
bbw free online dating
May 19, 2021 at 6:41 pmbbw free online dating
fake number for tinder
May 15, 2021 at 3:53 pmfake number for tinder
how to get real ip of user when you enable Cloudflare CDN for Nginx/Apache – rock funs