Forum Discussion
Rewrite http host and URL with iRule
Hi Community,
I would greatly appreciate a little help with this challenge:
External clients will hit the LTM with a own http host "connect.test.company.org/URI" and we do need to modify this requests that the webserver understands it: "abctest.company.org/connect/URI
As I am not very familiar with developing, I wanted to ask if anyone can check this iRule or give me a better idea 🙂
Thanks, Manuel
12 Replies
- Manuel_60430
Nimbostratus
sorry, the rule is missing: when HTTP_REQUEST { if { [HTTP::host] starts_with "connect" } { HTTP::redirect "https://abctest.company.org/connect/[HTTP::uri]" } } Hi Manuel, HTTP::redirect tell user's browser to go to a different location, that is different from what you need.
I suggest you to use rewrite profile, so you don't need to create an irule. Find below a good explanation and example: http://support.f5.com/kb/en-us/products/big-ip_ltm/manuals/product/ltm-implementations-11-5-0/23.html
If you use HTTPS, yes it's required because F5 needs to "read" the http traffic.
- Manuel_60430
Nimbostratus
Ok, got it.
Is there any way I can solve this without terminating SSL? I guess we would consider using an iRule in this case, right?
I don't think you can do what you need without SSL termination, because you have to change the URI sent to the backend servers.
- Manuel_60430
Nimbostratus
One last question: if I use a rewrite profile, will it keep the paths or queries behind the host that I am redirecting? E.g. user accesses "connect.test.company.org/test/site/query" will it be translated to "abctest.company.org/connect/test/site/query"?
- Manuel_60430
Nimbostratus
Ok, I understand that part.
If the user will come up with different http paths or queries, is there anyway to maintain this values. Unfortunately we cannot define all paths a user potentially could go, so we need a wildcard (as we would use the [HTTP::uri] or [HTTP::path] in an iRule.
you can also rewrite only the host, if makes sense: http://connect.test.company.org/ ---> http://abctest.company.org/
- Manuel_60430
Nimbostratus
Alright, thank you. I will try if a combination of rewriting the host and uri, but keeping the rest of the http path is possible. Else wise I will use iRule. Thanks for your support!
- ccna55_14039
Nimbostratus
tiziano, Where is that GUI Application from for Portal Re Write, I have not seen this before?
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
