Forum Discussion
exclude HTTP::header value Content-Type] equals "text/xml; charset=utf-8" from SSL redirect
- Jun 04, 2023
AhmadJ I believe the following iRule should fix what you are referring to. I recommend testing this before putting into production or performing the change in off hours in order to minimize possible downtime if by chance the change is incorrect.
when HTTP_REQUEST priority 500 { STREAM::disable } when HTTP_RESPONSE priority 500 { if { ([HTTP::header Content-Type] contains "text/html") && !([HTTP::header Content-Type] == "text/xml; charset=utf-8") } { STREAM::expression {@http://@https://@} STREAM::enable } elseif { ([HTTP::header Content-Type] contains "png") || ([HTTP::header Content-Type] contains "jpeg") || ([HTTP::header Content-Type] contains "application/x-font-woff") || ([HTTP::header Content-Type] contains "pdf") || ([HTTP::header Content-Type] contains "svg") || ([HTTP::header Content-Type] contains "image/svg+xml")} { STREAM::disable } }
AhmadJ Would you be able to provide the existing iRule configuration? Are you doing the force SSL on the F5 side or server side?
pauljthis is the irule whicg we use
when HTTP_REQUEST {
STREAM::disable
}
when HTTP_RESPONSE {
if { [HTTP::header Content-Type] contains "text/html" } {
STREAM::expression {@http://@https://@}
STREAM::enable
}
elseif { ([HTTP::header Content-Type] contains "png") or ([HTTP::header Content-Type] contains "jpeg") or ([HTTP::header Content-Type] contains "application/x-font-woff") or ([HTTP::header Content-Type] contains "pdf") or ([HTTP::header Content-Type] contains "svg") or ([HTTP::header Content-Type] contains "image/svg+xml")} {
STREAM::disable
}
}
fforce SSL hapening on F5
- PauliusJun 04, 2023MVP
AhmadJ I believe the following iRule should fix what you are referring to. I recommend testing this before putting into production or performing the change in off hours in order to minimize possible downtime if by chance the change is incorrect.
when HTTP_REQUEST priority 500 { STREAM::disable } when HTTP_RESPONSE priority 500 { if { ([HTTP::header Content-Type] contains "text/html") && !([HTTP::header Content-Type] == "text/xml; charset=utf-8") } { STREAM::expression {@http://@https://@} STREAM::enable } elseif { ([HTTP::header Content-Type] contains "png") || ([HTTP::header Content-Type] contains "jpeg") || ([HTTP::header Content-Type] contains "application/x-font-woff") || ([HTTP::header Content-Type] contains "pdf") || ([HTTP::header Content-Type] contains "svg") || ([HTTP::header Content-Type] contains "image/svg+xml")} { STREAM::disable } }
- AhmadJJun 06, 2023Altocumulus
Thank u Paulius now it is working as excpected
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