Forum Discussion

EddieV_26235's avatar
EddieV_26235
Icon for Nimbostratus rankNimbostratus
Nov 09, 2011

rewriting location header data

I'll just jump right into the good stuff. Here's my scenario:

 

 

wget --no-check-certificate -S "https://69.80.196.153/zap?aid=10000066&sid=6&can=fffffffffffffffe" -O /dev/null 2>&1 | grep " Location: " | grep --color "http://"

 

Location: https://bh.contextweb.com/bh/rtset?do=add&pid=536088&ev=4614711881901867008&rurl=http://matcher-cwb.bidder7.mookie1.com/do-association?return=ctxweb%26can=fffffffffffffffe

 

Location: http://matcher-cwb.bidder7.mookie1.com/do-association?return=ctxweb&can=fffffffffffffffe

 

Location: http://ib.adnxs.com/getuid?http://matcher-apx.bidder7.mookie1.com/appnexus?can=ffffffffffffffee%26adnxs_uid=$UID

 

 

 

 

A customer has requested to see if the possibility exists to rewrite the location headers from http to https. The first "location: https" is the F5. We are terminating the ssl connection on the F5 and passing the connection to a pool of servers on port 80. We are using an HTTP profile to rewrite the response to https. Is it possible to rewrite the rest of the location headers in the response?

 

 

 

I found and tried the iRule below but didn't work:

 

 

 

whenHTTP_RESPONSE{

 

 

14

 

 

15 Check if response type is text

 

 

16 if{[HTTP::headervalue Content-Type] contains"text"}{

 

 

17

 

 

18 Replace http:// with

 

 

19 STREAM::expression{@http://@https://@}

 

 

20

 

 

21 Enable the stream filter for this response only

 

 

22 STREAM::enable

 

 

23 }

 

 

24 }

 

 

 

Any help would be greatly appreciated.

 

 

 

Thanks in advance!

 

 

1 Reply

  • Replied here:

     

    http://devcentral.f5.com/Community/GroupDetails/tabid/1082223/asg/50/aft/2158759/showtab/groupforums/Default.aspx

     

     

    Aaron