Forum Discussion

Yozzer's avatar
Yozzer
Icon for Nimbostratus rankNimbostratus
Aug 14, 2012

sporadic redirect

Hi

 

 

The last part of the following irule (respond) doesnt always trigger:

 

 

when HTTP_RESPONSE {

 

 

if {$param == 1} {return}

 

 

if {$bcooky == 1} {HTTP::cookie insert name "Site" value "Test" path "/"

 

HTTP::cookie expires "Site" 2678400}

 

 

if {$param == 0} {HTTP::respond 404 content "Page not Found\

 

Page Not Found" }

 

 

I have put log commands in and it does trigger the if statement (== 0) but do you know why it doesnt trigger the respond?

 

 

Thanks

 

 

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

     

     

    That seems like it should work fine. Do you have any modules enabled on the virtual server?

     

     

    Can you post the full anonymized iRule and logs showing the failure? Else, I suggest opening a case with F5 Support so they can review your full config.

     

     

    Aaron
  • Yozzer's avatar
    Yozzer
    Icon for Nimbostratus rankNimbostratus
    Thanks Aaron

     

     

    No modules enabled apart from ASM. I think this is a proxy/browser problem as i can access the respond 404 externally.

     

     

    Cheers for the reply.
  • Yozzer's avatar
    Yozzer
    Icon for Nimbostratus rankNimbostratus
    Hi Aaron

     

     

    Within the HTTP_Request section param is set to 0 if a user goes to a certain path (i.e. https://site.com). We have ASM on so if a user goes to a page that is allowed in the ASM policy (i.e. https://site.com/stop) the param is still set to 0 but we get a connection page reset in the browser and the respond doesnt happen:

     

     

    when HTTP_RESPONSE {

     

     

    if {$param == 1} {return}

     

     

    if {$bcooky == 1} {HTTP::cookie insert name "Test" value $value path "/" domain ".test.com"

     

    HTTP::cookie expires "Test" 172800 }

     

     

    if {$param == 0} {

     

    log local0. " should redirect"

     

    ASM::disable

     

    set dtime 1

     

    HTTP::respond 200 content \ html stuff here

     

     

    Is ASM interfering here?

     

     

    Thanks
  • Yozzer's avatar
    Yozzer
    Icon for Nimbostratus rankNimbostratus
    I moved the respond into the HTTP_Request section and i don't see this issue now.

     

     

    Thanks