Varnish and Subdomains
Sheldon Dsouza
sheldond at gmail.com
Mon Jun 21 12:36:55 CEST 2010
Hi Marc,
Thanks for your reply, i have made the necessary changes in my
configuration and things seem to be working fine now.
Regards,
Sheldon
On Sun, Jun 20, 2010 at 8:32 PM, Marc Fournier <marc.fournier at camptocamp.com
> wrote:
> Hello,
>
> > tastykhana.in - for users of our site.
> > client.tastykhana.in - for our clients which requires authentication.
> > admin.tastykhana.in - for our call center which requires
> > authentication.
> >
> > After setting up varnish the user site tastykhana.in worked perfectly
> > but the subdomains started redirecting to the parent domain
> > tastykhana.in.
>
> As your 3 websites seem to be hosted on the same backend, the only way
> for your webserver to differentiate them is the "Host" HTTP header. Try
> commenting out this line:
>
> set req.http.host = "tastykhana.in";
>
> This will let the "Host" header from user's browser get passed to the
> backend without getting altered by varnish.
>
> > How do i prevent the subdomains from caching? as they require
> > authentication and i have also added the check for Cookies which
> > passes the request directly to backend server apache.
>
> The default behaviour is to not cache documents with HTTP
> authentication, so you shouldn't need to do anything. But if prefer,
> you can always do something like this:
>
> if (req.http.host == "client.tastykhana.in" ||
> req.http.host == "admin.tastykhana.in") {
> return (pass);
> }
>
> I hope this will help !
> Marc
>
>
> _______________________________________________
> varnish-misc mailing list
> varnish-misc at varnish-cache.org
> http://lists.varnish-cache.org/mailman/listinfo/varnish-misc
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20100621/952a422b/attachment-0002.html>
More information about the varnish-misc
mailing list