CDN subdomain handling (hiding) in Varnish

Shibashish shib4u at
Mon Apr 25 17:53:42 CEST 2011

2011/4/25 Roberto O. Fernández Crisial <roberto.fernandezcrisial at>

> Hi,
> I think what you need to do is to code your website ( with
> img/css/js/etc source code from "" instead
> "/images/abc.jpg".
> All you need to do is to update your IMG/CSS/JS (and all your static files)
> liks from your source code and point them to "".
> Roberto
> @rofc
> On Mon, Apr 25, 2011 at 12:12 PM, Shibashish <shib4u at> wrote:
>> Hi All,
>> My website is being served by varnish. I also have a CDN setup from where
>> i serve the static content for my websites (jpg, js, css).
>> Before CDN, the static content on the site was being served as www/
>>,, etc. After CDN,
>> the static files are being served through a new domain as
>> How do I stop my site from being visible on I want to
>> let the static content be served out of CDN and the origin pull be happening
>> from Varnish.
>> ShiB.
>> while ( ! ( succeed = try() ) );
>> _______________________________________________
>> varnish-misc mailing list
>> varnish-misc at
Thanks Roberto for explaining. My website source is already modified to
serve content from the cdn domain, ie is live
and being served from the CDN. Now, alongwith my images/css/js, the main
website is also seen when i go to Since the codebase is
same and the html/php files are present, the main site is also visible if
someone types in the cdn domain. I don't want this and want not to serve the
site on the cdn domain.

Can I do a exact match on the cdn domain and redirect to the main domain?
i.e. "" gets directed to, but should not be redirected. Or is there a
better way?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the varnish-misc mailing list