Forum Discussion
Mhelvin_Mory_63
Nimbostratus
Aug 11, 2006i-Rule to change http header
Hi All
I'm using BIG-IP as SSL termination and loadbalancer for SAP web application. But some web contents are not display properly and suspect this could be cause by some contents not converted properly from http to https.
(captured from Mozilla live header)
sap-ext-sid=&sap-cssurl=http%3A%2F%2Fqptlgrp%3A50000%2Firj%2Fportalapps%2Fcom.sap.portal.design.urdesigndata%2Fthemes%2Fportal%2Fsap_tradeshow%2Fur%2Fur_nn7.css%3F7.0.5.0.0&sap-cssversion=7.0.7.0.0&com.sap.portal.reserved.wd.pb.restart=false&DynamicParameter=
Is it possible for i-Rule to change the header content "http%3A%2F%2Fqptlgrp%" to "https%3A%2F%2Fqptlgrp%"
Thanks all.
- hoolio
Cirrostratus
There a a few different ways to replace one string with another. You can use string map (Click here) with the format (where all variables are strings):when HTTP_REQUEST { if { [HTTP::header exists my_header] }{ save current value for my_header set my_val [HTTP::header value my_header] log current value log local0. "my_val: $my_val" replace all instances of http with https in the string set my_new_val [string map { http https } $my_val] log updated value log local0. "my_new_val: $my_new_val" replace the value of my_header with the updated string HTTP::header replace my_header $my_new_val log updated header value log local0. "replaced header value: [HTTP::header value my_header]" } }
when HTTP_REQUEST { if { [HTTP::header exists my_header] }{ HTTP::header replace my_header [string map { http https } [HTTP::header value my_header]] } }
- hoolio
Cirrostratus
A couple of other small things... - Mhelvin_Mory_63
Nimbostratus
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