我正在写一个Kong插件(v.0.13),想知道在哪里/如何从API中找到匹配的URI。例如,使用以下 uris
uris
uris: ["/endpoint/[\da-f]{8}"]
之后,API将在任何8位十六进制数上匹配 /endpoint kong.request.get_path() ngx.req.get_path() ,但这两个都返回nil值/抛出错误。理想情况下,如果 /[0-9a-z?=] 我希望在单个字段中匹配整个URI,包括任何查询参数(即URI的主机和端口组件之后的所有内容)。
/endpoint
kong.request.get_path()
ngx.req.get_path()
/[0-9a-z?=]
看来 kong 0.13时不可用,我不得不 ngx.var.uri
kong
ngx.var.uri