Catch /js on all domains and rewrite the host

Guillaume Quintard guillaume at varnish-software.com
Mon Feb 1 09:49:35 CET 2016


Hi Matt,

would something like that do:

sub vcl_recv {
    if (req.url ~ "^/js/") {
       set req.http.host  = "subdomain.domain.tld";
    }
}

?


-- 
Guillaume Quintard

On Sun, Jan 31, 2016 at 6:31 PM, Matt . <yamakasi.014 at gmail.com> wrote:

> Hi All,
>
> I'm fuguring out how I can accomplish the following:
>
> I have subdomain.domain.tld but as this is a rewrite the olders like
> /js are not directly available on it.
>
> As my subdomains .domain.tld are dynamic I wonder if I can catch /js
> from reg.url for all incoming host(requests) and rewrite it to a
> source folder  on another host so it can be served on:
>
> subdomain.domain.tld/js
>
> My script lookups /js/whatever.js which is needed for these libs.
>
> Is there some catchall technique to accomplish this ?
>
> Thanks!
>
> Matt
>
> _______________________________________________
> varnish-misc mailing list
> varnish-misc at varnish-cache.org
> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20160201/4d2649a4/attachment.html>


More information about the varnish-misc mailing list