regsub, string concatenation?

Jon Drukman jsd at
Mon Apr 21 20:14:29 CEST 2008

Poul-Henning Kamp wrote:
> In message <fuail6$ksu$1 at>, Jon Drukman writes:
>> i'm trying to rewrite all incoming URLs to include the http host header 
>> as part of the destination url.  example:
>>  set req.url = regsub(req.url, "^", "/site/" +;
> You can't do it directly right now, but this may be a feasible
> workaround:
> 	set req.http.foobar = "/site/"
> 	set = regsub(req.url, "^", req.http.foobar);
> 	unset req.http.foobar;

Thanks for the ideas.  I ended up just moving the original host request 
into a different header and modifying the origin server to look for that 
header instead of looking in the URL.


More information about the varnish-misc mailing list