HTTP to HTTPS on Port Number 8001

Hi ,

Virtual server configured on port 8001 with ssl offloading , i’m able to access the url eg : https://happylife.com:8001/tmd . But application team wants redirect on this url when user access on http .

I mapped the default Irule In VS to redirect and also tried with below i rule , No luck . Looking for solution .

when HTTP_REQUEST { if {[HTTP::host] contains “http://happylife.com:8001/tmd”}{ HTTP::redirect “https://happylife.com:8001/tmd” } else {} }

Gopinath,

You can’t check protocol in http headers and host header won’t contain http://

Hopefully the following irule will help: Redirect_non_ssl_requests_on_ssl_vs_rule

See this post for more details: force-ssl-on-one-port

N

I have the same requirement, if user try the URL with HTTPS, no change in URL. If user try to access with HTTP, should redirect to https, I am also using non-standard port URLS.

https://abc.com:8888 ==> no change

http://abc.com:8888 ==> redicet to https://abc.com:8888

1) Create SSL Client profile with allowing Non-SSL Connections ( You need to modify default config)

2) Create VIP with 8888 port and use SSL client profile

3) Configure below iRule

when HTTP_REQUEST {

if { [URI::protocol [HTTP::uri]] eq “http” } {

HTTP::redirect https://[getfield [HTTP::host] “:” 1]:[TCP::local_port][HTTP::uri]

}

}