Forum Discussion

ema_128890's avatar
ema_128890
Icon for Nimbostratus rankNimbostratus
Jul 07, 2016

offload ssl and adding new uri

Hi,

 

I have a VS setup for port 443 with client ssl profile and a pool with one member. HTTP profile is also in use. I'm looking for help so that when someone hits the VS at https://abc.com it will add the uri /reports to it. Here is the irule i have so far.

 

when HTTP_REQUEST { if { [HTTP::uri] eq "/" } { HTTP::redirect "https://[HTTP::host]/reports" } }

 

I'm getting too many redirects when using this irule. Is this the path I should be looking into or something totally different?

 

Thanks

 

  • Hi,

    Try adding a log on your irule and trace what happens on the client side with fiddler tool.

    You can also change your irule :

    when HTTP_REQUEST { 
      if { [HTTP::uri] eq "/" } { 
      HTTP::uri "/reports" 
      } 
    }
    

7 Replies

  • Hi,

    Try adding a log on your irule and trace what happens on the client side with fiddler tool.

    You can also change your irule :

    when HTTP_REQUEST { 
      if { [HTTP::uri] eq "/" } { 
      HTTP::uri "/reports" 
      } 
    }
    
    • ema_128890's avatar
      ema_128890
      Icon for Nimbostratus rankNimbostratus
      Thanks I forgot to setup a http VS to redirect all the http traffic back to https. Fiddler was a great help.
    • ema_128890's avatar
      ema_128890
      Icon for Nimbostratus rankNimbostratus
      Yann, one other question is that if I want to redirect to add a port and uri to the url like 8020:/reports what will I need to add to the above irule? Thanks in advance
  • Hi,

    Try adding a log on your irule and trace what happens on the client side with fiddler tool.

    You can also change your irule :

    when HTTP_REQUEST { 
      if { [HTTP::uri] eq "/" } { 
      HTTP::uri "/reports" 
      } 
    }
    
    • ema_128890's avatar
      ema_128890
      Icon for Nimbostratus rankNimbostratus
      Thanks I forgot to setup a http VS to redirect all the http traffic back to https. Fiddler was a great help.
    • ema_128890's avatar
      ema_128890
      Icon for Nimbostratus rankNimbostratus
      Yann, one other question is that if I want to redirect to add a port and uri to the url like 8020:/reports what will I need to add to the above irule? Thanks in advance
  • Reply to the last comment :

    Option 1:

    when HTTP_REQUEST { 
      if { [HTTP::uri] eq "/" } { 
      HTTP::host "[HTTP::host]:8020"
      HTTP::uri "/reports" 
      } 
    }
    

    Option 2 (require a VS listening on 8020 :

    when HTTP_REQUEST { 
      if { [HTTP::uri] eq "/" } { 
      HTTP::respond 301 Location "https://[HTTP::host]:8020/reports" "Connection" "Close"
      } 
    }