mirror of
https://github.com/alibaba/higress.git
synced 2026-02-06 23:21:08 +08:00
31 lines
917 B
YAML
31 lines
917 B
YAML
apiVersion: extensions.istio.io/v1alpha1
|
|
kind: WasmPlugin
|
|
metadata:
|
|
name: gw-error-format
|
|
namespace: higress-system
|
|
spec:
|
|
selector:
|
|
matchLabels:
|
|
higress: higress-system-higress-gateway
|
|
pluginConfig:
|
|
rules:
|
|
- match:
|
|
statuscode: "200"
|
|
responsebody: "bar"
|
|
replace:
|
|
statuscode: "401"
|
|
responsebody: "{\"code\":401,\"message\":\"User is not authenticated\"}"
|
|
- match:
|
|
statuscode: "503"
|
|
responsebody: "no healthy upstream"
|
|
replace:
|
|
statuscode: "200"
|
|
responsebody: "{\"code\":404,\"message\":\"No Healthy Service\"}"
|
|
set_header:
|
|
- access-control-allow-credentials: "true"
|
|
- access-control-allow-origin: "*"
|
|
- access-control-expose-headers: "*"
|
|
- content-type: "application/json;charset=UTF-8"
|
|
- custom-header: "HelloWorld"
|
|
url: oci://docker.io/zhangjiahaol/envoy-plugin:gw-error-format-2.0.0
|