Forum Discussion

Gopinath_Vedagi's avatar
Gopinath_Vedagi
Icon for Nimbostratus rankNimbostratus
Oct 03, 2014

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 {} }

 

2 Replies

  • 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]

     

    }

     

    }