Forum Discussion

Aiche_Hamid_241's avatar
Aiche_Hamid_241
Icon for Nimbostratus rankNimbostratus
Jun 25, 2012

Https redirect and pool selection

Hi all

 

 

I need to write an irule doing two things :

 

 

 

1 - offload SSL and redirect http requests to https

 

 

 

2 - make a pool selection based on the object type requested

 

ex : for *.php --> send to pool php_pool

 

for * --> pool to static_pool

 

 

 

so it should look to something like :

 

 

 

http-->https

 

when HTTP_REQUEST {

 

HTTP::redirect https://[HTTP::host][HTTP::uri]

 

}

 

 

 

 

dispatch requests

 

when HTTP_REQUEST priority 501 {

 

switch -glob [HTTP::path] {

 

*.php { pool php_pool }

 

default { pool static_pool }

 

}

 

}

 

 

 

 

The problem : it looks like the dispatching section is never processed ! whats wrong with this code ?

 

 

 

Thanks for all

 

 

 

Hamid

 

3 Replies

  • hoolio's avatar
    hoolio
    Icon for Cirrostratus rankCirrostratus
    Hi Aiche,

     

     

    Make sure to only apply the HTTP to HTTPS redirect rule to your HTTP virtual server and the dispatch iRule to your HTTPS virtual server.

     

     

    Aaron
  • Thanks Aaron, i will try it tomorrow and bring you feedback asap.

     

     

    Best regards

     

     

    Hamid