Forum Discussion

MrGlass_204919's avatar
MrGlass_204919
Icon for Nimbostratus rankNimbostratus
Sep 12, 2017

irule not working

Hi folks,

Can someone look at this irule and tell me why its not working and how it should be formatted.

        when HTTP_REQUEST {
        log local0. "Request: [HTTP::URI]" {
        Path begins with "/zak/por.*html" 
        Dyn Webseal
        if { [HTTP::path] starts_with "/zak/por.*html} {
        Stat content to SCS DMZ
         Disable serverside SSL 
         Change host header to zp-cli-exp.d.n
            pool EXP_zak.d.n-static-pool_HTTP
            persist none
            SSL::disable serverside
            if { [HTTP::host] equals "zak.d.n"} {
                  if {[HTTP::uri] contains "zak/por/"} {
                  HTTP::header replace "Host" "zp-cli-exp.d.n"                         
                  log local0. "Rewrite zak por" 
        } else {
        Dyn Content to Webseal
         pool EXP_zak.d.n-https_pool
            log local0. "Default"

                    }
                }
           }
      }
}

Im getting: [undefined procedure: HTTP::URI][HTTP::URI] ?

2 Replies

  • Hi,

    You use HTTP::URI and not HTTP::uri. And the entry "/zak/por.html should be "/zak/por.html"

    Try this one:

       when HTTP_REQUEST {
          log local0. "Request: [HTTP::uri]" 
          Path begins with "/zak/por.*html" 
          Dyn Webseal{
         if { [HTTP::path] starts_with "/zak/por.*html" } {
         Stat content to SCS DMZ
          Disable serverside SSL 
          Change host header to zp-cli-exp.d.n
            pool EXP_zak.d.n-static-pool_HTTP
            persist none
            SSL::disable serverside
            if { [HTTP::host] equals "zak.d.n"} {
                  if {[HTTP::uri] contains "zak/por/"} {
                  HTTP::header replace "Host" "zp-cli-exp.d.n"                         
                  log local0. "Rewrite zak por" 
        } else {
        Dyn Content to Webseal
              pool EXP_zak.d.n-https_pool
                 log local0. "Default"
    
                    }
                }
           }
      }
    }
    

    Regards, Martijn