Forum Discussion
Gerardo_Garcia_
Jul 09, 2008Nimbostratus
Excluding some urls for the STREAM conversion
I have the following iRule that converts http to https for external users only as defined on the internal_net
However, when the page contains calls to google.com, amazon.com, ebay.com i...
hooleylist
Jul 09, 2008Cirrostratus
Hi Gerardo,
I assume the issue is with the stream profile rewriting references within the page content from http:// to https://. I expect the app isn't redirecting with a 30x to google or other external sites.
You can use a negative lookbehind regex to specify the search string in the stream expression. There is an example on the STREAM::enable wiki page (Click here). I've added a few more examples to the STREAM::expression page (Click here) as well.
STREAM::expression {@http://(?!(?:www\.)?amazon\.com|google\.com|ebay\.com)@https://@}
Would match the bolded sections for these test cases:
http://example.com
http://google.com
http://www.amazon.com
http://amazon.com
http://ebay.com
http://test.com
I'm not sure how much drain this would add on CPU and/or memory. If you can positively define what strings you want to rewrite with a simpler regex, it would be less resource intensive.
Also, it would be a good idea to disable the stream filter using STREAM::disable by default and only enable it when the content-type header value matches your test. This ensures that the stream filter isn't applied to subsequent HTTP responses on the same TCP connection. There is an example of this on most of the stream wiki pages.
Aaron
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