Forum Discussion

eLeCtRoN's avatar
eLeCtRoN
Icon for Cirrus rankCirrus
May 07, 2015

iRule URL rewrite, request header rewrite, response header rewirte

Hi,

 

I have a reverse proxy transfer from Bluecoat to F5, now my question ! How can I do the same as in my Bluecoat config via iRule ?

 

here is my config !!!

 

 

 

 

; ------------------------------------------------------------

 

; Rewrite Server Pages

 

; Syntax:

 

; rewrite_url_substring "client_url_substring" "server_url_substring"

 

; ------------------------------------------------------------

 

define url_rewrite rewrite_pages

 

; Rewriting http links

 

rewrite_url_prefix "https://shop.example.com" "http://row.jump.net:8000"

 

rewrite_url_substring "shop.example.com" "row.jump.net"

 

; Rewriting embedded html links to external links

 

; Rewriting embedded javascript links to external links

 

rewrite_script_substring "shop.example.com" "row.jump.net"

 

end url_rewrite rewrite_pages

 

; ------------------------------------------------------------

 

; TWURL

 

; ------------------------------------------------------------

 

define action twurl

 

; Rewrite Client Request Header

 

rewrite( request.header.host, "shop.example.com", "row.jump.net")

 

rewrite( request.header.referer, "*)", "http://row.jump.net:8000$(1)" )

 

; Rewrite Server Response Header

 

rewrite( response.header.Set-Cookie, "(.)jump.net(.)", "$(1)example.com$(2)" )

 

rewrite( response.header.Location, ")", "https://shop.example.com$(1)" )

 

rewrite( response.header.Content-Location, ")", "https://shop.example.com$(1)" )

 

; Rewrite Page Content transform rewrite_pages

 

end action twurl

 

; ------------------------------------------------------------

 

;Delete Accept-Encoding Header

 

; ------------------------------------------------------------

 

define action ForceUncompressedResponse

 

delete( request.header.Accept-Encoding )

 

end action ForceUncompressedResponse

 

 

 

 

maybe someone can give me a example iRule, I would say the URL rewrite is easy but how have to look the other thinks I don't know ! It would be nice when I get help to realize this Bluecoat config in a iRule.

 

THX Manu

 

2 Replies

  • i think you may get response faster if you can tell exactly what you want. otherwise, you may have to wait someone here who is familiar with bluecoat cpl. just my 2c.
  • Hi,

     

    The reason why, is the F5 get access from the VS to the Node but it gives problems with the link in combo with java and the SAP system so we make a redirect to the URL form the Node, the Node URL is not accessible form the internet. The Bluecoat config realize in the Bluecoat a access to an SAP system (java based) the URL rewirte in the Bluecoat config is a redirect and work forward and also backward, and it should rewirte javascript links ! You can everything see in the Bluecoat config from the first post. After this make the Bluecoat config a request header rewrite and response header rewirte with variables to set the correct URL also coockie, location and content-location. And the last is the compression they should be off ! I want to realize this with a F5 iRule but me iRule know how is not wide enough.

     

    THX Manu