Re: [pylons-discuss] How to fix request.client_addr

2016-04-29 Thread Jonathan Vanasco
On Thursday, April 28, 2016 at 9:47:50 PM UTC-4, Zsolt Ero wrote: > > Thanks, that's a great howto, unfortunately, I'd need to compile nginx > from sources to get that module. > Unless you don't have root access, compiling nginx from source is honestly the best way to deploy your server.

Re: [pylons-discuss] How to fix request.client_addr

2016-04-28 Thread Zsolt Ero
Thanks, that's a great howto, unfortunately, I'd need to compile nginx from sources to get that module. On 29 April 2016 at 03:03, Jonathan Vanasco wrote: > You can do this in nginx. > > Cloudflare publishes a list of trusted ips; the nginx set_real_ip module > will only

Re: [pylons-discuss] How to fix request.client_addr

2016-04-28 Thread Jonathan Vanasco
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,

Re: [pylons-discuss] How to fix request.client_addr

2016-04-28 Thread Zsolt Ero
Hi, can you guide me how is it best to do it? I'm using nginx -> gunicorn -> pyramid, where should I be modifying the WSGI environment? On Thursday, 28 April 2016 17:57:13 UTC+2, Bert JW Regeer wrote: > > Set up the WSGI environment appropriately, replacing the X-Forwarded-For > with the

Re: [pylons-discuss] How to fix request.client_addr

2016-04-28 Thread Bert JW Regeer
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 wrote: > > I got a weird bug, in which request.client_addr was reported as > 192.168.76.75:52411, which broke a

[pylons-discuss] How to fix request.client_addr

2016-04-28 Thread Zsolt Ero
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 ->