Forum Discussion

souravkayal_287's avatar
souravkayal_287
Icon for Nimbostratus rankNimbostratus
Oct 27, 2017

IRule to redirect to https:8443

so I have a VS on 8443 with ssl and nodes on 9502 I am setting up a redirection http VS on 9500 and it should redirect all requests to the HTTPS VS on 8443. Facing some issues.

 

I had made this:

 

when HTTP_REQUEST { HTTP::redirect "https://[HTTP::host]:8443[HTTP::uri]" }

 

2 Replies

  • when connecting to the URL http://srv.company.com:9500, the Host header is srv.company.com:9500. you have to strip the port before adding the destination port.

    you can do it with

    [getfield [HTTP::host] ":" 1]

    when HTTP_REQUEST { 
        HTTP::redirect "https://[getfield [HTTP::host] ":" 1]:8443[HTTP::uri]" 
    }
    
  • Hi,

     

    You created 2 threads about the same service! are both different issues?

     

    if the issue is the server replies with URL http://srv.company.com:8443, you have to correct it on server side or with HTTP response rewriting.

     

    if some request comes on port 8443 and are not encrypted because of user error, this is not the same solution.