I am playing with standalone mode of APISix v3.7.0 and would like to establish two global rules based on the response-rewrite plugin as catch-all for client errors (4xx) and server errors (5xx).
The global rules section of my current configuration in apisix.yaml looks like this:
global_rules:
-
id: 1
plugins:
response-rewrite:
headers:
Content-Type: "text/plain"
body: "Client error"
vars:
-
- "status"
- ">="
- 400
-
- "status"
- "<"
- 500
-
id: 2
plugins:
response-rewrite:
headers:
Content-Type: "text/plain"
body: "Server error"
vars:
-
- "status"
- ">="
- 500
Each rule works individually, but I somehow cannot make them work together. Only the second rule (id 2) seems to be active. So far, I haven't found any example with more than one global rule.
Is there something wrong with my configuration? Or is it not possible to have two global rules for the same plugin?
Could both global rules perhaps be combined in a single global rule?