Forum Discussion

Edouard_Zorrill's avatar
Edouard_Zorrill
Icon for Nimbostratus rankNimbostratus
Oct 28, 2016

irule redirect and switch -glob: Default sentence question

Guys, I have the following:

when HTTP_REQUEST {

    switch -glob [string tolower [HTTP::uri]] {
      "/app1" { 
            pool app1_pool 
      }
      "/app2" { 
            pool app2_pool 
      }
      "/app3/" {
            pool app3_pool
      }
      default { 
            ACCESS::session remove 
      }
     }
}

Rather than killing the session with "ACCESS::session remove", what I can use there to send 404 to all pages that are default.

Thanks,

2 Replies

  • If you are looking to serve content with 404 status, you can try something like:

    HTTP::respond 303 content [ifile get PAGE_404]

  • Hi,

     

    you should also use ACL in APM:

     

    • rule 1 : /app1 : Allow
    • rule 2 : /app2 : Allow
    • rule 3 : /app3 : Allow
    • rule 4 : /app1 : reject

    assign it in ACL assign or Advance ressource assign.

     

    with ACL, APM will respond with a dedicated reject page.