Forum Discussion
Simple Reverse Proxy with iRules
- May 27, 2020
Hi, I know u said u want to make this using iRule - but I recommend you do it with policies. L7 policies use much less CPU than iRules and are easier to administer.
You create a virtual server and add a tcp and http profile - no other profiles needed. than you create a new pool with the node you need. than you create a new policy and in there, create a new rule with the conditions:
When:
"http host is any of f5wiki.pva.sozvers.at at request
Then:
Replace http host with value "mediawiki.pva.sozvers.at" at request
Forward traffic to pool "your pool" at request
Your failure with the iRule is the "http::redirect" . this sends a response to the client with the redirect to the new DNS name. this is wrong. If u want to do this with iRule:
when HTTP_REQUEST {
if { [HTTP::host] eq "f5wiki.pva.sozvers.at"} {
HTTP::header replace "f5wiki.pva.sozvers.at" "mediawiki.pva.sozvers.at"
pool /Common/yourpoolname
}
(not tested)
Hi, I know u said u want to make this using iRule - but I recommend you do it with policies. L7 policies use much less CPU than iRules and are easier to administer.
You create a virtual server and add a tcp and http profile - no other profiles needed. than you create a new pool with the node you need. than you create a new policy and in there, create a new rule with the conditions:
When:
"http host is any of f5wiki.pva.sozvers.at at request
Then:
Replace http host with value "mediawiki.pva.sozvers.at" at request
Forward traffic to pool "your pool" at request
Your failure with the iRule is the "http::redirect" . this sends a response to the client with the redirect to the new DNS name. this is wrong. If u want to do this with iRule:
when HTTP_REQUEST {
if { [HTTP::host] eq "f5wiki.pva.sozvers.at"} {
HTTP::header replace "f5wiki.pva.sozvers.at" "mediawiki.pva.sozvers.at"
pool /Common/yourpoolname
}
(not tested)
Thank you for your answer! I got it in the meantime ;)
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