Forum Discussion

7 Replies

  • Edited after Stan's comment: Updated with starts_with, had missed -glob (added now)

    Use any one of the below,

    If else condition,

    when HTTP_REQUEST {
    if { [HTTP::uri] starts_with "/app/prod/" } {
    pool Prod_Pool
    } else {
    pool Dev_Pool
    }
    }
    

    Using switch,

    when HTTP_REQUEST {
    switch -glob [string tolower [HTTP::uri]] {
    "/app/prod/*" { pool Prod_Pool }
    "/app/dev/*" { pool Dev_Pool }
      }
    }
    
    • Koti_Reddy_Kol1's avatar
      Koti_Reddy_Kol1
      Icon for Nimbostratus rankNimbostratus

      Thanks Jaykumar, Piron, and Dan for your response. I will try the options given to me.