regsub, string concatenation?

Poul-Henning Kamp phk at
Mon Apr 21 08:19:29 CEST 2008

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

	set req.http.foobar = "/site/"
	set = regsub(req.url, "^", req.http.foobar);
	unset req.http.foobar;

Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.

More information about the varnish-misc mailing list