POST x-forwarded-for

Bedis 9 bedis9 at gmail.com
Thu Jun 24 13:24:26 CEST 2010


Hi,

In which hook have you put your peace of code?

cheers


On Thu, Jun 24, 2010 at 10:45 AM, Alex F <alex at acasa.ro> wrote:
> Hello,
>
> I'm trying to make varnish forward the IP of the request to the backend.
> While I have succeeded in doing so with GET requests, I cannot do the same
> with POST requests.
> I have found the following link ( http://varnish-cache.org/ticket/203 )
> which says:
>
> "post mode is trickier. Assuming the request is an HTTP request, it is of
> course possible to add / modify X-Forwarded-For before entering post mode,
> but it won't be possible to modify subsequent requests on the same
> connection. This can be mitigated by also adding Connection: close to the
> request."
>
> There is also a piece of VCL code:
> if (bereq.http.x-forwarded-for) {
>     set bereq.http.X-forwarded-for =
>     bereq.http.X-forwarded-for ", "
>     regsub(client.ip, ":.*", "");
>     } else {
>     set bereq.http.X-forwarded-for =
>     regsub(client.ip, ":.*", "");
>  }
>
> But I cannot seem to convince varnish.
> Please advise.
>
>
> _______________________________________________
> varnish-misc mailing list
> varnish-misc at varnish-cache.org
> http://lists.varnish-cache.org/mailman/listinfo/varnish-misc
>



More information about the varnish-misc mailing list