-
Notifications
You must be signed in to change notification settings - Fork 378
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
【建议】配置路由策略时对“非”表达式的支持 #937
Comments
这个可能短期不会支持,一方面 Ingress API/Gateway API 都没有对与非匹配这种路由条件的定义; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
使用场景
在配置路由的路径、请求头、请求参数时,有需要表达“非”关系的场景。例如:现有一个路由/animal,在配置请求头时,希望只要符合 animal≠cat 时都导去 dog 的页面。
已尝试的方法
目前在 Higress Console 上,对于路径、请求头和请求参数的匹配条件都支持正则匹配:
所以尝试过使用 负向前瞻断言 来表达非的关系,如:
但是并没有成功
咨询过 zty,他说目前还不支持这种正则语法,但是我们这边确实存在这样的需求。
附上 Traefik 的做法
之前我们也了解过 Traefik,它对路由策略的与或非是这样解决的:
The text was updated successfully, but these errors were encountered: