Forum Discussion
Redirecting part of a URL
The DNS record and the cert for the openshift URL are both wildcarded. so anything that has the *.datacenter.example.com is going to hit the VIP that has the openshift routers behind it. Once it hits the openshift router it sends the traffic to the correct app depending on what is before the .datacenter.example.com in the URL. It's a separate wildcarded DNS based on the datacenter. Openshift is only set up to accept traffic from the routes configured. We're trying to get away from using the specific datacenter in the developers code but also trying not to have to configure a new route inside of openshift.
theirapp1.datacenter.example.com --> resolved to openshift router VIP expecting *.datacenter.example.com --> routes to correct openshift container based on theirapp1
Openshift has to see the .datacenter.example.com to allow the traffic. And all of the applications hit this same VIP.
desired
devs hit GTM theirapp.example.com --> traffic forwarded to appropriate LTM pair in active datacenter that *.datacenter.example.com resolves to --> LTM irule flips theirapp.example.com to theirapp.datacenter.example.com --> traffic goes through to pool member with new URL and openshift expects this host route.
Also obviously i could do this for each individual app but there are many. I wanted to see if there was a way where i could take any request coming in that was in theirapp.example.com and flip it to theirapp.datacenter.example.com
- PauliusOct 06, 2023
MVP
SteveD1979 Do you intend for this to be a redirect or a rewrite that only the pool member sees? Is the "theirapp" always the same length and in the 3rd section of the FQDN?
- SteveD1979Oct 06, 2023
Cirrostratus
I think either would work and it would always be whatever comes before the example.com but different legnths
- PauliusOct 06, 2023
MVP
SteveD1979 If you will always convert .gtm. to .datacenter. you can do the following.
when HTTP_REQUEST priority 500 { if {[HTTP::host] contains ".gtm."} { HTTP::host [string map {".gtm." ".datacenter."}[HTTP::host]] } } - SteveD1979Oct 06, 2023
Cirrostratus
Thanks I tried that but it isn't flipping it.
- SteveD1979Oct 06, 2023
Cirrostratus
Does it matter that this is a performance layer 4 VIP?
- PauliusOct 06, 2023
MVP
SteveD1979 If this is HTTP traffic you can change it to a standard, apply an HTTP profile, and the irule in question and it should work. If you are doing HTTPS communication it would require that you change it to standard, HTTP profile, SSL client profile, and the iRule and it should work.
- SteveD1979Oct 06, 2023
Cirrostratus
Ok thanks. Per openshift the VIP has to be layer 4 but i was able to put the HTTP profile on it since the one we're testing is http and since it let me add the irule with http_request i thought it might be ok.
- PauliusOct 09, 2023
MVP
SteveD1979 Sadly, with an SSL connection and you do not have SSL termination being performed on a standard VS you cannot have an HTTP profile because the F5 cannot look at the HTTP header since it's encrypted.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com