chuckcald_15879
May 28, 2014Nimbostratus
Help with Irule to redirect url port and pass POST data
Hi all.
Users must use https://sso.domain.com/sp/ACS.saml2 to pass their SSO (Single Sign ON) to our SP servers.
Our SP server listens on port 9031.I need the SSO POST data coming to https://sso.domain.com/sp/ACS.saml2 to be redirected to https://sso.domain.com:9031/sp/ACS.saml2. Traffic to https://sso.domain.com:9031/sp/ACS.saml2 needs to sent to our "SSO" VIP.
The iRule have written doesn't pass the POST data through the redirect. Can anyone be so kind as to review my iRule?
when HTTP_REQUEST {
Check if request was a POST
if { [string tolower [HTTP::method]] eq "post" } {
Check if there is a Content-Length header
if { [HTTP::header exists "Content-Length"] } {
if { [HTTP::header "Content-Length"] > 1048000 }{
Content-Length over 1Mb so collect 1Mb
set content_length 1048000
} else {
Content-Length under 1Mb so collect actual length
set content_length [HTTP::header "Content-Length"]
}
} else {
Response did not have Content-Length header, so use default of 1Mb
set content_length 1048000
}
Don't collect content if Content-Length header value was 0
if { $content_length > 0 } {
HTTP::collect $content_length
}
}
}
when HTTP_REQUEST_DATA {
if {[TCP::local_port] == 443 and [HTTP::uri] contains "/sp/ACS.saml2"}{
HTTP::redirect https://sso.domain.com:9031/sp/ACS.saml2
}
if {[TCP::local_port] == 9031 and [HTTP::uri] contains "/sp/ACS.saml2"}{
virtual SSO_9031
} else {
return
}
}