Forum Discussion

5 Replies

  • gopalp I believe this is would be something that has to be tracked server side. You can perform a redirect after someone goes to https://abc.com/api-status to https://xyz.com but because this is most likely going to be a new session to a new FQDN the F5 isn't going to know how to interpret this and provide content to the user. You should be able to provide some sort of transaction ID, cookie, or referer that allows the xyz.com site to know that the user is looking for the contents of the output from abc.com/api-status.

  • gopalp's avatar
    gopalp
    Icon for Nimbostratus rankNimbostratus

    Thank you for the update.Can you please share a sample iRule to achieve above usecase.

    • Paulius's avatar
      Paulius
      Icon for MVP rankMVP

      gopalp To perform the simple redirect it would be the following but if you did it on the F5 you would never receive the unique HTTP header from the server to carry over the users session after they went to the path you are referring to.

      when HTTP_REQUEST priority 500 {
      
          if {[HTTP::host] == "abc.com"} {
              if {[HTTP::uri] == "/api-status"} {
                  HTTP::redirect "https://xyz.com/"
              }
          }
      
      }
  • if you control both the abc.com and xyz.com domains, you can do this by hosting both abc.com and xyz.com in your SNI list on the the client-ssl profile of the single virtual (or...use a different virtual and keep the client-ssl profiles separate). And the iRule that Paulius shared would be on the shared virtual or only on the abc.com virtual. I'd tweak the iRule slightly but it's fine the way it is.

    when HTTP_REQUEST priority 500 {
        if {([HTTP::host] == "abc.com") && ([string tolower [HTTP::uri]] == "/api-status")} {
            HTTP::redirect "https://xyz.com/"
        }
    }
  • gopalp - If your post was solved it would be helpful to the community to select *Accept As Solution*.
    This helps future readers find answers more quickly and confirms the efforts of those who helped.
    Thanks for being part of our community.
    Lief