Changing the fetch for virtual hosts.

Chris Johnson johnson at
Thu Feb 3 21:42:25 CET 2011


      Very new to varnish.  Still re-re-re-reading the  documentaion.
Read is one thing undestanding is another.

      I have one Apache server serving multiple virtual hosts.  I'm
trying to phase out one host and point people to another virtual host
on the same server serviced by the same varnish.  For various reasons
I can't just cut one off.

      IF (big IF) I'm reading things right here, it looks like I can
rewrite the host name in vcl_recv after the request is received but
before the fetch.  If I do this in vcl_recv;

if ( ~ "^") {
set = "";

will the request go to the new host?  The idea is to stop varnish from
basically cache everything twice since both and
point to the same set of pages.  I don't want varnish doing double duty
here.  All varish knows is that the URLs are different and if I
understand correctly will treat them as different sets of pages
caching both.

      Thnak you.

Chris Johnson               |Internet: johnson at
Systems Administrator       |Web:
NMR Center                  |Voice:    617.726.0949
Mass. General Hospital      |FAX:      617.726.7422
149 (2301) 13th Street      |An object will fall so as to do the most damage.
Charlestown, MA., 02129 USA | The law of selective gravity.

The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.

More information about the varnish-misc mailing list