Skip to content

How to negate a condition in "route_rule.data"? #1045

Discussion options

You must be logged in to vote

Condition does support Logical NOT operator "!".
The Expression:

"Cond": "!req_path_prefix_in(`/register|/recover|/swap`, false)",

would reject any path which is prefixed with /register, /recover , or /swap, for example, /register /registerabc /register/abc, etc. What's path you used in the test?

And in your conf file, primitive "default_t()" is used, so any request which doesn't match following conditions would fall back to cluster "cluster_other_page"

"Cond": "req_cookie_key_in(`sample-session`)",
"Cond": "!req_path_prefix_in(`/register|/recover|/swap`, false)",

By the way, in the official documentation you can find it in this format:
"Cond: "req_cookie_key_in("sample-session")"

Howe…

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@curiosport
Comment options

@daimg
Comment options

@curiosport
Comment options

@daimg
Comment options

@curiosport
Comment options

Answer selected by mileszhang2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants