Changing the fetch for virtual hosts.

Chris Johnson johnson at nmr.mgh.harvard.edu
Thu Feb 3 21:42:25 CET 2011


      Hi,

      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 (req.http.host ~ "^old.host.edu") {
set req.http.host = "new.host.edu";
}

will the request go to the new host?  The idea is to stop varnish from
basically cache everything twice since both new.host and old.host
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 nmr.mgh.harvard.edu
Systems Administrator       |Web:      http://www.nmr.mgh.harvard.edu/~johnson
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
http://www.partners.org/complianceline . 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