Forum Discussion

rodrigo_Benzaqu's avatar
rodrigo_Benzaqu
Icon for Nimbostratus rankNimbostratus
Jun 01, 2005

what I have wrong in this rule

 

when HTTP_REQUEST {

 

if { [HTTP::uri] starts_with "/fd/" }

 

{

 

use pool FD_SERVERS

 

} elseif

 

{

 

use pool Mexico

 

}

 

}

 

 

 

01070151:3: Rule [FD_MLA] error:

 

line 2: [missing a script after "if"] [ ]

 

line 3: [undefined procedure:

 

use pool FD_SERVERS

 

] [{

 

use pool FD_SERVERS

 

} elseif

 

{

 

use pool MLA

 

}]

 

 

Thanks guys

 

6 Replies

  • Replace the elseif with else, or supply another condition with the elseif statement.
  • Ok, now look a this.

     

     

    when HTTP_REQUEST {

     

    if { [HTTP::uri] starts_with "/fd/" }

     

    {

     

    use pool FD_SERVERS

     

    }

     

    }

     

     

    01070151:3: Rule [FD_RESTO] error:

     

    line 2: [missing a script after "if"] [ ]

     

    line 3: [undefined procedure:

     

    use pool FD_SERVERS

     

    ] [{

     

    use pool FD_SERVERS

     

    } ]

     

     

  • You need to have the opening curly brace on the same line as the if statement.

    when HTTP_REQUEST {   
       if { [HTTP::uri] starts_with "/fd/" } {   
         use pool FD_SERVERS   
       }    
     }

  • Thanks Joe.

     

     

    If I want to add this rule to my virtual server, when I do it I receive :

     

     

    01070394:3: HTTP_REQUEST event in rule (FD_FETCH) requires an associated HTTP or FASTHTTP profile on the virtual server (resto).

     

     

    The virtual server "resto" is for http. What do I miss ?

     

     

    Thanks in advance

     

    Rodrigo

     

     

  • Your Virtual Server must have an associated HTTP profile assigned to it to be able to receive the HTTP_REQUEST event. Look on the configuration page for your Virtual Server and you'll see a dropdown list with the title "HTTP Profile". You can either select the default "http" base profile or one that you've created that is derived from http.

     

     

    You can also receive this event if your Virtual Server is of type "Performance (HTTP)" and you have a Protocol Profile derived from "fasthttp" assigned to it.

     

     

    -Joe