Forum Discussion
HTTPS rewrite
Hi Thomas
So initially we have the following irule setup on a http virtual server with the intention of anything being requested to
www.abc.com/t/abc (HTTP) to be redirected to www.def.com/t/abc (HTTPS - obviously real urls being marked out).
This seems to be a little problematic
when HTTP_REQUEST {
if { [HTTP::host] contains "www.abc." and [HTTP::uri] starts_with "/t/" } {
HTTP::respond 301 location "https://[HTTP::host][HTTP::uri]"
}
}
Once the redirect takes place the client hits the HTTPS Virtual server. On that Virtual server we have the following irule setup with the intention of rewriting www.abc.com/t/abc (HTTPS) to www.def.com/www.abc.com/t/abc (HTTPS - as you can see maintaining the uri and previous host header).
when HTTP_REQUEST {
if { [HTTP::header host] contains "www.abc." and [HTTP::uri] starts_with "/t/" } {
HTTP::uri "/[HTTP::host][HTTP::uri]"
HTTP::header replace host "www.def.com"
}
}
Currently the https server has a ssl client profile and a default pool that pushes requests to the server that can respond with a 200 to www.def.com/t/abc. The connection to the default pool has to be a https connection. So a few questions here.....a) the irule(s) above don't seem to be producing the behaviour we need, can you see any issues? b) I'm unsure how to deal with the https connection, decryption, irule processing and then sending the connection back to the default pool as a HTTPS connection
Thanks for taking the time to look
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