Forum Discussion
Viversector_326
Nimbostratus
Jul 05, 2017Remove port number from URL
Hello,
I have a VIP running on port 443 which connects to our back end web servers running port 80. I have the following irule setup to change URLs from http to https. The problem I have is some...
Jad_Tabbara__J1
Cirrostratus
Jul 06, 2017Hello Viversectors,
You have two options :
1) The proper manner is to do it from the backend servers by modifying absolute links by relative links:
Relative links looks like /toto/tata
Absolute links are similar to
2) If you cannot change it or ask for that, you can modify your irule to modify also the domain.com:80 by domain.com and the Location header if contains http://
when HTTP_REQUEST {
STREAM::disable
if { [HTTP::header exists "Accept-Encoding"] } {
HTTP::header remove "Accept-Encoding"
}
if { [HTTP::header exists "Location"] } {
set Location [HTTP::header Location]
if { $Location contains "http://"} {
HTTP::header replace Location [string map {"http://" "https://"} [HTTP::header Location]]
}
}
}
when HTTP_RESPONSE {
if {[HTTP::header value Content-Type] contains "text" || [HTTP::header value Content-Type] contains "xml" } {
Replace http:// with https:// and domain.com:80 by domain.com
STREAM::expression [list {@http://@https://@} {@domain.com:80@domain.com@}]
Enable the stream filter for this response only
STREAM::enable
}
}
I think with this irule you will cover all your need.
Waiting for your update.
Regards
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