Forum Discussion
Gordon_O_138935
Nimbostratus
Feb 05, 2018HTTP Redirect retaining source Port
We have an application server that, depending on the port, will provide a different applications web page.
When I try to force https the port is getting removed resulting in the Default page showing ...
Feb 06, 2018
Your example shows:
redirected to
This iRule will do that:
when CLIENT_ACCEPTED {
TCP::collect 5
}
when CLIENT_DATA {
switch -glob [TCP::payload] {
"GET *" -
"POST *" -
"PUT *" -
"OPTIONS *" -
"DELETE *" -
"TRACE *" -
"CONNECT *" -
"HEAD *" {
set redirect 1
SSL::disable clientside
}
}
TCP::release
}
when HTTP_REQUEST {
if { [info exists redirect] } {
HTTP::respond 302 noserver Connection close Location "https://[HTTP::host][HTTP::uri]"
unset redirect
}
}
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