Forum Discussion

gdoyle's avatar
gdoyle
Icon for Cirrostratus rankCirrostratus
Jun 06, 2019
Solved

Masking a URL?

I have a customer who has a contract that is requiring that we hide what is essentially an internal URL. Right now when people go to the site they see:

https://subdomain.companya.com

What the contract is requiring is that they see:

https://subdomain.differentdomain.com

They asked if this was possible through the F5. I vaguely remember one of my old teammates mentioning that the F5 could do this via an iRule, but all of the "URL masking" or "URL rewrite" things I have been able to find have actually been for the URI, not the URL.

Does anyone know if this is actually possible via the F5, and if so, does anyone have any documentation or know what is required to make this happen?

Thanks.

  • Nothing is imposible on F5 🙂

    First of all, you need to configure your customer DNS to reach one F5's virtual server (subdomain.differentdomain.com).

    This VS has to have a pool of nodes of the new domain (subdomain.companya.com).

    After that, yo can replace the host header using an iRule like this.

    when HTTP_REQUEST {
       # Check if requested host starts with subdomain.differentdomain.com
       if { [string tolower [HTTP::host]] eq "subdomain.differentdomain.com" } {
          # Replace the host header value with subdomain.companya.com
          HTTP::header replace Host "subdomain.companya.com"
       }
    }

    KR,

    Dario.

5 Replies

  • Nothing is imposible on F5 🙂

    First of all, you need to configure your customer DNS to reach one F5's virtual server (subdomain.differentdomain.com).

    This VS has to have a pool of nodes of the new domain (subdomain.companya.com).

    After that, yo can replace the host header using an iRule like this.

    when HTTP_REQUEST {
       # Check if requested host starts with subdomain.differentdomain.com
       if { [string tolower [HTTP::host]] eq "subdomain.differentdomain.com" } {
          # Replace the host header value with subdomain.companya.com
          HTTP::header replace Host "subdomain.companya.com"
       }
    }

    KR,

    Dario.

  • gdoyle's avatar
    gdoyle
    Icon for Cirrostratus rankCirrostratus

    Thanks, Dario.

    So you are saying that the the Virtual Server the customer's are hitting initially would have to consist of the subdomain.companya.com Virtual Server, or it would need to have the actual pool members for subdomain.companya.com?

    • Hello gdoyle

       

      If I understood well...

       

      You want to hide this domain ->

      subdomain.companya.com

      And you want to show this domain instead ->

      subdomain.differentdomain.com

       

      For this reason, your configuration should be something like this:

       

      CUSTOMER -> VS (subdomain.differentdomain.com) -> POOL (subdomain.companya.com)

       

      In case you need something totaly opposite. you just have to replace one domain for another in the iRule and the schema.

       

      KR,

      Dario.