cancel
Showing results for 
Search instead for 
Did you mean: 

http to https based on url

cymru81
Altocumulus
Altocumulus

Hi, wondering if someone can help, we have two http sites running on a single VIP eg livesite.domain.com and testsite.domain.com is it possible to redirect them to the https equivalent with an irule?

 

For single sites we have applied below and this works fine:

 

when HTTP_REQUEST {

  TCP::respond "HTTP/1.1 302 Found\r\nLocation: https://examplesite.domain.com\r\nConnection: close\r\nContent-Length: 0\r\n\r\n"

  TCP::close

 

}

1 REPLY 1

Hello,

 

You can create one VIP using same IP address as that of existing https VIP and keep it listening on http (80) port. And bind F5 provided redirect iRule to it - 'sys_https_redirect'

 

This VIP will redirect all request to https.

 

Hope it helps!

Mayur