Phoebus888 commented on issue #1532:
URL:
https://github.com/apache/apisix-ingress-controller/issues/1532#issuecomment-1354326212
配置规则为
```
apiVersion: apisix.apache.org/v2
kind: ApisixRoute
metadata:
name: method-route
namespace: middle-platform-uat
spec:
http:
- name: method
match:
filter_func: "function(vars)\n local core = require
('apisix.core')\n local body, err = core.request.get_body()\n if not body
then\n return false\n end\n\n local data, err = core.json.decode(body)\n
if not data then\n return false\n end\n\n if data['foo'] == 'bar'
then\n return true\n end\n\n return false\nend"
hosts:
- test.01lb.vip
paths:
- /*
exprs:
- subject:
scope: Header
name: User-Agent
op: RegexMatch
value: ".*dev.*"
backends:
- serviceName: mp-outer-gateway
servicePort: 8080
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]