Forum Discussion
iRule redirection HTTPS to port 2001
Hi this regarding my old question but more specific:
Setup:
VIP1: 1.1.1.1:443
irule: use to redirect
VIP2: 1.1.1.1:2001
POOL: 2.2.2.2:2001
So what I want is if the user access:
- https://1.1.1.1/Administration/services/ it should redirect it to http://1.1.1.1:2001/Administration/services/
- https://1.1.1.1/Administration/services/EyeQNissanSF?WSDL it should redirect it to http://1.1.1.1:2001/Administration/services/EyeQNissanSF?WSDL
- https://1.1.1.1/Administration/services/abcd it should redirect it to http://1.1.1.1:2001/Administration/services/abcd
and so on...
Can anyone help me build an iRule for this
- Koalan
Cirrus
will this work:
when HTTP_REQUEST {
if { [HTTP::host] eq "1.1.1.1" } {
HTTP::redirect http://1.1.1.1:2001[HTTP::uri]
}
}
- jaikumar_f5
Noctilucent
Share us your VIP1: 1.1.1.1:443 configuration.
#tmsh list ltm virtual <vip1-name>
- Koalan
Cirrus
ltm virtual 1.1.1.1_443 {
destination 1.1.1.1:https
ip-protocol tcp
mask 255.255.255.255
profiles {
clientssl {
context clientside
}
http { }
tcp { }
}
rules {
sfws_irule
}
source 0.0.0.0/0
source-address-translation {
type automap
}
translate-address enabled
translate-port enabled
vs-index 220
}
ltm virtual 1.1.1.1_2001 {
destination 1.1.1.1:2001
ip-protocol tcp
mask 255.255.255.255
pool POOL_2.2.2.2
profiles {
tcp { }
}
source 0.0.0.0/0
source-address-translation {
type automap
}
translate-address enabled
translate-port enabled
vs-index 221
}
The irule above is the one i used. and i think it works.
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