Forum Discussion

Ram_381760's avatar
Ram_381760
Icon for Nimbostratus rankNimbostratus
Feb 04, 2019

external domainname replace and uri masking

Hello Everyone,

 

I'm new to iRule and looking help on iRule on F5 BIG-IP which has successfully configured VIP with DNS (https://api-internal.net/docs) and able to resolve VIP using browser. The problem F5 BIG-IP is not able keep track/control on its own VIP once HTTP::redirect to external domain and uri, no iRule logic is working after HTTP::redirect. I'm looking to handle the external domain traffic along with domainname replace and uri masking and F5 LB should only show its local domain and uri which is https://api-internal.net/docs but internally it should redirect to get all traffic from external domain and uri - https://anypoint.example.com/exchange/portals/example-serv-3/ which I'm not able to make this working.

 

I have tried from my end and went thru this page https://devcentral.f5.com/wiki/iRules.STREAM__enable.ashx which have all possible example cover at the end of page either iFrame or proxypass or uri masking etc, and nothing is much helpful and I need suggestions or pointers to solve this.

 

Thanks

 

4 Replies

  • Are you saying that you want to rewrite redirects or the HTML links on the page? They are two different things.

     

  • Try this instead - it will change all redirects to be this host

    when HTTP_RESPONSE {
        if { [HTTP::header exists Location] } {
            set path [URI::path [HTTP::header Location]]
            set query [URI::query [HTTP::header Location]]
            set location "https://my.host$path?$query"
            HTTP::header replace Location $location
            log local0. "Rewriting Location [HTTP::header Location] to $location"
        }
    }
    

    Install and run this and check the logs in /var/log/ltm