[users@httpd] mod_ext_filter with proxied content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



G'day,

	We have an Apache + Squid + Zope combination running Plone for our main
site on a server located in Hong Kong (http://www.globalhand.org).
Sadly Hong Kong is a few transoceanic links from most of our users (USA
and Europe) so we have employed the services of a CDN to serve most of
our smaller objects; images, JS and CSS to improve page load times.

	It is not possible to specify different domains for objects in Plone eg
have pages served from www.example.com and images from cdn.example.com,
it is an all or nothing approach; all objects have to be served from the
same domain (the base URLs are generated by the Virtual Host Monster).
Fixing this behaviour in Plone is a large undertaking and would require
changing virtually every page template, breaking future compatability
with upgrades or 3rd party products.

	We are looking at the use of mod_ext_filter and sed to dynamically
rewrite the URLs of images, JS and CSS after the page has been rendered
by Zope/Plone but we have struck a few issues.  The filtering works well
when the object is local to Apache (fetched from the local filesystem),
but does not work when the content is proxied (fetched from the
Squid/Zope backends).  It appears that the filters are not applied when
the content is proxied.

	Below is a sanitised section of our configuration file:

ExtFilterDefine rewritecdnurl mode=output intype=text/html \
	cmd="/bin/sed 's/www\.example\.org/cdn\.example\.org/g'"

<IfModule mod_rewrite.c>
	RewriteEngine on

	RewriteRule ^/error/ - [L]
	RewriteRule ^/(.*)
http://localhost:8077/VirtualHostBase/http/%{HTTP_HOST}:80/nav_root/VirtualHostRoot/$1 [L,P]

	SetOutputFilter rewritecdnurl
</IfModule>

	I realise the filter at this point will rewrite every URL on the page,
it it just for testing purposes.  We are running Apache 2.0.59 compiled
from source on CentOS 4.3/4.4.  How does one configure Apache to do
this?  We would be very grateful for any assistance given as we have had
to disable the CDN service until this issue has been resolved.



				Many Thanks,

				Tom Pike

-- 
+------------------------------------------+
| Tom Pike thwpike@xxxxxxxxxxxxxxxxxxx     |
| P3 International www.p3international.org |
+------------------------------------------+

Attachment: signature.asc
Description: This is a digitally signed message part


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux