mirror of
https://github.com/alibaba/higress.git
synced 2026-03-01 23:20:52 +08:00
131 lines
5.8 KiB
YAML
131 lines
5.8 KiB
YAML
admin:
|
|
address:
|
|
socket_address:
|
|
protocol: TCP
|
|
address: 0.0.0.0
|
|
port_value: 9901
|
|
static_resources:
|
|
listeners:
|
|
- name: listener_0
|
|
address:
|
|
socket_address:
|
|
protocol: TCP
|
|
address: 0.0.0.0
|
|
port_value: 10000
|
|
filter_chains:
|
|
- filters:
|
|
- name: envoy.filters.network.http_connection_manager
|
|
typed_config:
|
|
"@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
|
|
scheme_header_transformation:
|
|
scheme_to_overwrite: https
|
|
stat_prefix: ingress_http
|
|
route_config:
|
|
name: local_route
|
|
virtual_hosts:
|
|
- name: local_service
|
|
domains: ["*"]
|
|
routes:
|
|
- match:
|
|
prefix: "/"
|
|
route:
|
|
cluster: httpbin
|
|
http_filters:
|
|
- name: wasmdemo
|
|
typed_config:
|
|
"@type": type.googleapis.com/udpa.type.v1.TypedStruct
|
|
type_url: type.googleapis.com/envoy.extensions.filters.http.wasm.v3.Wasm
|
|
value:
|
|
config:
|
|
name: wasmdemo
|
|
vm_config:
|
|
runtime: envoy.wasm.runtime.v8
|
|
code:
|
|
local:
|
|
filename: ./main.wasm
|
|
configuration:
|
|
"@type": "type.googleapis.com/google.protobuf.StringValue"
|
|
value: |
|
|
{
|
|
"grayKey": "userId",
|
|
"backendGrayTag": "x-mse-tag",
|
|
"userStickyMaxAge": 172800,
|
|
"rules": [
|
|
{
|
|
"name": "inner-user",
|
|
"grayKeyValue": [
|
|
"00000001",
|
|
"00000005"
|
|
]
|
|
},
|
|
{
|
|
"name": "beta-user",
|
|
"grayKeyValue": [
|
|
"noah",
|
|
"00000003"
|
|
],
|
|
"grayTagKey": "level",
|
|
"grayTagValue": [
|
|
"level3",
|
|
"level5"
|
|
]
|
|
}
|
|
],
|
|
"rewrite": {
|
|
"host": "frontend-gray-cn-shanghai.oss-cn-shanghai-internal.aliyuncs.com",
|
|
"notFoundUri": "/cygtapi/{version}/333.html",
|
|
"indexRouting": {
|
|
"/app1": "/cygtapi/{version}/index.html",
|
|
"/": "/cygtapi/{version}/index.html"
|
|
},
|
|
"fileRouting": {
|
|
"/": "/cygtapi/{version}",
|
|
"/app1": "/cygtapi/{version}"
|
|
}
|
|
},
|
|
"baseDeployment": {
|
|
"version": "base"
|
|
},
|
|
"grayDeployments": [
|
|
{
|
|
"name": "beta-user",
|
|
"version": "gray",
|
|
"enabled": true
|
|
}
|
|
],
|
|
"injection": {
|
|
"head": [
|
|
"<script>console.log('Header')</script>"
|
|
],
|
|
"body": {
|
|
"first": [
|
|
"<script>console.log('hello world before')</script>",
|
|
"<script>console.log('hello world before1')</script>"
|
|
],
|
|
"last": [
|
|
"<script>console.log('hello world after')</script>",
|
|
"<script>console.log('hello world after2')</script>"
|
|
]
|
|
}
|
|
},
|
|
"html": "<!DOCTYPE html>\n <html lang=\"zh-CN\">\n<head>\n<title>app1</title>\n<meta charset=\"utf-8\" />\n</head>\n<body>\n\t测试替换html版本\n\t<br />\n\t版本: {version}\n\t<br />\n\t<script src=\"./{version}/a.js\"></script>\n</body>\n</html>"
|
|
}
|
|
- name: envoy.filters.http.router
|
|
typed_config:
|
|
"@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router
|
|
clusters:
|
|
- name: httpbin
|
|
connect_timeout: 30s
|
|
type: LOGICAL_DNS
|
|
dns_lookup_family: V4_ONLY
|
|
lb_policy: ROUND_ROBIN
|
|
load_assignment:
|
|
cluster_name: httpbin
|
|
endpoints:
|
|
- lb_endpoints:
|
|
- endpoint:
|
|
address:
|
|
socket_address:
|
|
address: frontend-gray-cn-shanghai.oss-cn-shanghai.aliyuncs.com
|
|
port_value: 80
|