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
[email protected]
http://lists.varnish-cache.org/mailman/listinfo/varnish-misc

Reply via email to