avoiding disk cache on proxy ?

Igor Sysoev is at rambler-co.ru
Tue Jan 16 23:17:35 MSK 2007


On Tue, 16 Jan 2007, Jonathan Vanasco wrote:

> Just wondering on these lines though:
>
>>       proxy_set_header  X-Real-IP  $remote_addr;
>>       proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
>
> on my system, i use this:
>
> 	proxy_set_header Host $host;
> 	proxy_set_header X-Forwarded-For $remote_addr;
>
> which is where i go off into a tangent-
>
> 	isn't it bad form / dangerous to rely on x-forwarded-for from the 
> client for anything?
> 	shouldn't you force it to be $remote_addr ( it defaults to that if 
> there is no x-forwarded-for header ) in almost any situation ?

Of course, a client "X-Forwarded-For" is not reliable,
but you may log the header for some reason.

I usually pass a client address in "X-Real-IP" header and
the "X-Forwarded-For" header is passed as is.


Igor Sysoev
http://sysoev.ru/en/





More information about the nginx mailing list