Apache 2.2, Mod_rewrite and a cdn provider with a squid proxy cache
I have a general question and was wondering how and if someone has pulled this off. I am new to this so take it easy on the noob.
I am currently using vitalstream CDN provided by Internap and I am using a feature called origin pull which essentially acts as a squid proxy that caches my web content out to other servers globally.
I have a unique challenge in that I am needed to have my apache server serve as the origin host for the squid proxy cache to read, but also need direct requests to the site on the origin server to server content to another url (the CDN domain once the data is cached). Below is an example of a rewrite rule I am using:
Options Indexes FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP:Authorization} !(Basic\mybase64encryptedusernamepass)
RewriteRule ^/home/website/public_html/mydomain.com/(.*)\.(css|gif|jpg|jpeg|bmp|png|mp3|wmv|avi|mov|rm|exe|mpg|rar|zip|tif|tiff|txt)$ http://mycdndomain.com/$1.$2 [R,L,NC]
RewriteRule ^/home/website/public_html/mydomain.com/(.*)\.(css|gif|jpg|jpeg|bmp|png|mp3|wmv|avi|mov|rm|exe|mpg|rar|zip|tif|tiff|txt)$ http://mycdncomain.com/$1.$2 [R,L,NC]
Does anyone have any ideas on the best way to make this work?
Thanks!
|