Forum Discussion
Ramil_Ancajas_1
Nimbostratus
Jan 22, 2014Redirect HTTP request to HTTPS VS and rewrite new URI
Hi I have a service HTTPS VS with client SSL profile to offload SSL. It has two member server pool running on service tcp 9994. The site is to be accessed either using HTTP or HTTPS by using the VS I...
nitass
Employee
Jan 22, 2014user wants the LTM to be able to redirect HTTP traffic to HTTPS. And also we want to rewrite traffic as http://pool-member-ip:9994/xyz-uri when LTM forwards the request to the server pool.
https virtual server will change vs-ip to pool-member-ip:9994 itself. what you have to do is to redirect from http to https and change uri from / to /xyz-uri.
e.g.
config
root@(ve11a)(cfg-sync In Sync)(Active)(/Common)(tmos) list ltm virtual bar
ltm virtual bar {
destination 172.28.24.10:80
ip-protocol tcp
mask 255.255.255.255
profiles {
http { }
tcp { }
}
rules {
qux
}
source 0.0.0.0/0
vs-index 3
}
root@(ve11a)(cfg-sync In Sync)(Active)(/Common)(tmos) list ltm rule qux
ltm rule qux {
when HTTP_REQUEST {
if { [HTTP::uri] eq "/" } {
HTTP::redirect "https://[HTTP::host]/xyz-uri"
}
}
}
test
[root@ve11a:Active:In Sync] config curl -I http://172.28.24.10
HTTP/1.0 302 Found
Location: https://172.28.24.10/xyz-uri
Server: BigIP
Connection: Keep-Alive
Content-Length: 0
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects