Forum Discussion

boneyard's avatar
Jun 20, 2012

http and https redirect in one irule

i got two virtual servers, one for port 80 (http) and one for port 443 (https), is it possible to create one irule which can be used on both servers and where when used on the http server the redirects are done to http://... and on the https server the redirects are done to https://...

 

 

is this easily possible or would i be better off writing two irules?

 

  • Arie's avatar
    Arie
    Icon for Altostratus rankAltostratus
    Shouldn't be hard to do, just include a snippet to sniff out the port.
  • Arie's avatar
    Arie
    Icon for Altostratus rankAltostratus
    Shouldn't be hard to do, just include a snippet to sniff out the port.
  • Hi Boneyard,

     

     

    You could do this in one iRule by checking the TCP::local_port or SSL::mode values. But I think it's simpler and more efficient to just write separate iRules for HTTP and HTTPS.

     

     

    Aaron
  • ok, thanks for all the answers, ill see if i can work out the single iRule just for experience and see how complex it becomes.