regsub, string concatenation?

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


Poul-Henning Kamp wrote:
> In message <fuail6$ksu$1 at ger.gmane.org>, 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/" + req.http.host);
> 
> You can't do it directly right now, but this may be a feasible
> workaround:
> 
> 	set req.http.foobar = "/site/"
> 	set req.http.foo = 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.

-jsd-




More information about the varnish-misc mailing list