I need to redirect from http to https , also since some users have bookmark specific port for exmaple port 8050 in their browser to be redirect to https. how do I do that.
I’m not 100% sure of your requirements but this is a simple irule to redirect all http requests to the vs to https and removes any non-default port. Taken from: DevCentral
when HTTP_REQUEST {
HTTP::redirect https://[getfield [HTTP::host] ":" 1][HTTP::uri]
}
Not sure if this will apply but I have used this when we know what the URI starts with and we want to redirect them to a different path on the same host, this uses a 301 redirect instead of the normal 302
when HTTP_REQUEST {
if { [string toupper [HTTP::uri]] starts_with “/PATH1/PATH2/” }{
If I understand correctly you are just needing to redirect everything that isn’t 443 I would just put up two virtuals with the same IP one listening on ANY port and the other listening on 443 then just put in a http to https redirect on the ANY listener. The more specific listener will override the ANY to prevent any looping.
I already have VS_80 and VS_443 and applied redirect from 80 to 443, do I need to change 80 to all port or create new VIP with all port, and can this iRule work for redirect on *_VS ?
I already have VS_80 and VS_443 and applied redirect from 80 to 443, do I need to change 80 to all port or create new VIP with all port, and can this iRule work for redirect on *_VS ?