Set up the WSGI environment appropriately, replacing the X-Forwarded-For with 
the value of Cf-Connecting-Ip.

Bert

> On Apr 23, 2016, at 17:09, Zsolt Ero <[email protected]> wrote:
> 
> I got a weird bug, in which request.client_addr was reported as 
> 192.168.76.75:52411, which broke a function which expected it to be a 
> standard IP address. In the documentation I've read that this could be 
> anything, so I guess this isn't a surprise.
> 
> I am using CloudFlare -> nginx -> gunicorn -> pyramid setup. These were the 
> headers of that request:
> 
> X-Forwarded-For 192.168.76.75:52411,67.133.63.210, 108.162.246.204
> Cf-Connecting-Ip 67.133.63.210
> 
> My question is that since I'm using CloudFlare and I know that 
> Cf-Connecting-Ip is a reliable, trustable source of IP address, unlike 
> X-Forwarded-For. How should I modify my request.client_addr to use this value 
> whenever it is present?
> 
> Zsolt
> 
> 
> -- 
> 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/e643ca5d-763e-45bd-b077-d09b448b2fb8%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
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/ED5370EC-1590-4F36-9F97-F26572831BCA%400x58.com.
For more options, visit https://groups.google.com/d/optout.

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to