Forum Discussion
iyanus_39384
Dec 01, 2010Nimbostratus
Outbound iRule STREAM Rewrites for CDN
Hi Folks,
We have a legacy app that has a lot of static content that we want to move to a CDN. I have succesfully created a stream profile to do some of the outbound translation, however this is a lot of management overhead as each asset has to have an explicit source/dest rewrite string pair. Ideally I'd like to do it programatically.
What I am trying to to is rewrite outbound HTTP responses with string replacement of the form
search1: src="/path/to/static/asset.[jpg,gif,png,swf]"
replace1: src="http://my.cdn/path/to/static/asset.[jpg,gif,png,swf]"
I know it sounds easy but I am having major grief getting an iRule to work.
I have tried messing about with STREAM::expression and STREAM::replace but I can't seem to get my regexps to work.
Any Ideas?
Iain
- hooleylistCirrostratusHi Iain,
when STREAM_MATCHED { log local0. "[IP::client_addr]:[TCP::local_port]: matched: [STREAM::match], replaced with: [string map {http://devcentral.f5.com/ http://my.cdn/} [STREAM::match]]" STREAM::replace "[string map {http://devcentral.f5.com/ http://my.cdn/} [STREAM::match]]" }
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects