That one works but imposes a security issue for me.
http://cache.mysite.com/wp-config.php?test=site.js is now downloadable.
This is my setup:
UrlToolkit {
ToolkitID = cache
Match ^/.*\.(js|ico|gif|jpg|jpeg|png|css|svg)(/|$|\?) Return
Match .* DenyAccess
}
VirtualHost {
Hostname = www.mysite.com
WebsiteRoot = /var/www/mysite.com/html
ReverseProxy .* http://127.0.0.1:80 60 # apache backend
}
VirtualHost {
Hostname = cache.studioseverien.nl
WebsiteRoot = /var/www/mysite.com/html
UseToolkit = cache
}
As you can see I use a virtualhost for serving the js, css and images via cache.mysite.com.
It is not allowed to serve anything other than those files.