Rewrite foo.com to bla.com/$1 ?

Matt . yamakasi.014 at gmail.com
Wed Jan 7 13:55:17 CET 2015


Hi All,

In the past I tested some scripts on on varnish for rewriting a domainname.

My idea would be foo.com/* to bla.com/$1

Can I accomplish this with just something like:

if (req.http.host ~ "foo.com") {
set req.http.host = "bla.com/$1";
}

I'm trying to find examples but I only find much of the same like


foo.com/bla -> foo.com/bleh


Cheers,

Matt



More information about the varnish-misc mailing list