URI

  • patterns: String, representing multiple patterns, format is as “pattern1|pattern2”
  • case_insensitive: Bool, case insensitive

Host

  • req_host_in(patterns)

    • Judge if host matches configured patterns
    • Case insensitive

    • Note: the both sides of | can not be space```

      right:

      req_host_in(“www.bfe-networks.com|bfe-networks.com”)

    wrong:

  • req_path_in(patterns, case_insensitive)

    • Judge if request path matches configured patterns
  • req_path_prefix_in(patterns, case_insensitive)

    • Judge if request path prefix matches configured patterns
      1. // if path prefix is /abc,case insensitive
      2. req_path_prefix_in(“/x/y”, false)
  • req_path_suffix_in(patterns, case_insensitive)

    • Judge if request path suffix matches configured patterns
      1. // if path suffix is /abc,case insensitive
      2. req_path_suffix_in(“/x/y”, false)

Note:The patterns of req_path_in and req_path_prefix_in need to be included “/“

Query

    • Judge if query key matches configured patterns
  • req_query_key_prefix_in(patterns)

    • Judge if query key prefix matches configured patterns
      1. req_query_key_prefix_in(“abc”)
  • req_query_value_in(key, patterns, case_insensitive)

    • Judge if value of query key matches configured patterns
      1. # if the value of abc in query is XXX, case insensitive
  • req_query_value_prefix_in(key, patterns, case_insensitive)

    • Judge if value prefix of query key matches configured patterns
      1. # if the value prefix of abc in query is XXX, case insensitive
      2. req_query_value_prefix_in(“abc”, "XXX", true)
  • req_query_value_suffix_in(key, patterns, case_insensitive)

    • Judge if value suffix of query key matches configured patterns
    • Judge if the hash value of specified query matches configured patterns (value after hash is 0~9999)
      1. req_query_value_hash_in(“abc”, "100", true)
  • req_port_in(patterns)
    • Judge if port matches configured patterns
      1. # check if port is 80 or 8080
      2. req_port_in(“80|8080”)

URL

  • req_url_regmatch(patterns)
    • patterns is regular expression to match yrl
    • ` is recommended using
      1. req_url_regmatch(`/s\?word=123`)