Forum Discussion
mslater905
Nimbostratus
Nov 19, 2019Help with HTTPS_Rewrite iRule
Hi all, I'm currently in a bit of a pickle for developing an iRule solution to avoid HTTPS_Rewrite for certain URL's. I currently have an LTM VS configured which has a profile that rewrit...
Heinrichm5
Altocumulus
Nov 27, 2019I'm not certain I've understood the question correctly.
When I need to redirect all sites to HTTPS except a select few domains, I do like Vijay: create an irule
when HTTP_REQUEST {
set vhost [string tolower [HTTP::host]]
switch $vhost {
"http-domain1.local" -
"http-domain2.local" {
#now it uses the default settings of the vs, including any default pool you might have selected
}
default {
#Send a redirect to https - 307 to tell the client that it needs to use the same method as when it send the request to this port
HTTP::respond 307 Location "https://[getfield [HTTP::host] ":" 1][HTTP::uri]"
}
}
}If you have a lot of sites that need the exception you might be better served with a data group. It will make the irule shorter, however, every time you troubleshoot you'll have to look an additional place.
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
