Hi, IgorG is correct however the configuration does not include ALL of the CloudFlare IP addresses, I simply added them. You can find more information here:
https://support.cloudflare.com/hc/e...-do-I-restore-original-visitor-IP-with-Nginx-
vi /etc/nginx/conf.d/cloudflare.conf
# $remote_addr rewriting in case of NGINX behind CloudFlare.
# See also mod_cloudflare Apache module configuration.
#CloudFlare
set_real_ip_from 199.27.128.0/21;
set_real_ip_from 173.245.48.0/20;
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 141.101.64.0/18;
set_real_ip_from 108.162.192.0/18;
set_real_ip_from 190.93.240.0/20;
set_real_ip_from 188.114.96.0/20;
set_real_ip_from 197.234.240.0/22;
set_real_ip_from 198.41.128.0/17;
set_real_ip_from 162.158.0.0/15;
set_real_ip_from 104.16.0.0/12;
set_real_ip_from 172.64.0.0/13;
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;
real_ip_header CF-Connecting-IP;
You will also want to edit your Apache conf for Cloudflare
vi /etc/httpd/conf.d/cloudflare.conf
LoadModule cloudflare_module modules/mod_cloudflare.so
<IfModule mod_cloudflare.c>
CloudFlareRemoteIPHeader CF-Connecting-IP
# CloudFlare IP Ranges. For definitive IP range lists see
https://www.cloudflare.com/ips-v4 and
https://www.cloudflare.com/ips-v6.
# See also /etc/nginx/conf.d/cloudflare.conf if you have NGINX enabled. Please don't use DenyAllButCloudFlare option in this case.
CloudFlareRemoteIPTrustedProxy 103.21.244.0/22 103.22.200.0/22 103.31.4.0/22 104.16.0.0/12 108.162.192.0/18 141.101.64.0/18 162.158.0.0/15 172.64.0.0/13 173.245.48.0/20 188.114.96.0/20 190.93.240.0/20 197.234.240.0/22 198.41.128.0/17 199.27.128.0/21 2400:cb00::/32 2405:8100::/32 2405:b500::/32 2606:4700::/32 2803:f800::/32
</IfModule>
Then finish up with a:
service nginx restart
service httpd restart