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 value of Cf-Connecting-Ip. > > Bert > > > On Apr 23, 2016, at 17:09, Zsolt Ero <[email protected] <javascript:>> > 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] <javascript:>. > > To post to this group, send email to [email protected] > <javascript:>. > > 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/bfc47ce5-91bb-434a-8056-c018623d6200%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
