You can do this in nginx. Cloudflare publishes a list of trusted ips; the nginx set_real_ip module will only apply the real-ip header to those matching ips.
https://support.cloudflare.com/hc/en-us/articles/200170706-How-do-I-restore-original-visitor-IP-with-Nginx- you could do it in python, but it would be easier to just enable the nginx module -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/pylons-discuss/3976a70a-3e60-41f1-a94f-3afb6048637f%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
