237 lines
4.7 KiB
JSON
237 lines
4.7 KiB
JSON
{
|
|
"host_policies": [
|
|
{
|
|
"hosts": [
|
|
"localhost",
|
|
"127.0.0.1",
|
|
"demo.localhost"
|
|
],
|
|
"acl": {
|
|
"default": "deny",
|
|
"rules": [
|
|
{
|
|
"network": "127.0.0.0/8",
|
|
"action": "allow"
|
|
},
|
|
{
|
|
"network": "::1/128",
|
|
"action": "allow"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
],
|
|
"headers": {
|
|
"request": [
|
|
{
|
|
"op": "set",
|
|
"name": "x-rustproxy-example",
|
|
"value": "global"
|
|
}
|
|
],
|
|
"response": [
|
|
{
|
|
"op": "remove",
|
|
"name": "server"
|
|
},
|
|
{
|
|
"op": "set",
|
|
"name": "x-content-type-options",
|
|
"value": "nosniff"
|
|
}
|
|
]
|
|
},
|
|
"vhosts": [
|
|
{
|
|
"id": "example-1",
|
|
"frontend": {
|
|
"hosts": [
|
|
"localhost"
|
|
],
|
|
"listener_ids": [
|
|
"example-1-http"
|
|
]
|
|
},
|
|
"backends": [
|
|
{
|
|
"id": "demo",
|
|
"url": "http://127.0.0.1:9000",
|
|
"allow_private": true,
|
|
"preserve_host": true
|
|
}
|
|
],
|
|
"load_balancing": {
|
|
"health_check": {
|
|
"mode": "off"
|
|
}
|
|
},
|
|
"routes": [
|
|
{
|
|
"id": "demo",
|
|
"path_prefix": "/",
|
|
"backend_id": "demo",
|
|
"enabled": true,
|
|
"headers": {
|
|
"request": [
|
|
{
|
|
"op": "set",
|
|
"name": "x-rustproxy-example",
|
|
"value": "route"
|
|
}
|
|
],
|
|
"response": [
|
|
{
|
|
"op": "set",
|
|
"name": "x-rustproxy-demo",
|
|
"value": "enabled"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"id": "blocked-admin",
|
|
"path_prefix": "/admin",
|
|
"backend_id": "demo",
|
|
"enabled": true,
|
|
"acl": {
|
|
"default": "deny",
|
|
"rules": []
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"id": "example-2",
|
|
"frontend": {
|
|
"hosts": [
|
|
"127.0.0.1"
|
|
],
|
|
"listener_ids": [
|
|
"example-1-http"
|
|
]
|
|
},
|
|
"backends": [
|
|
{
|
|
"id": "demo",
|
|
"url": "http://127.0.0.1:9000",
|
|
"allow_private": true,
|
|
"preserve_host": true
|
|
}
|
|
],
|
|
"load_balancing": {
|
|
"health_check": {
|
|
"mode": "off"
|
|
}
|
|
},
|
|
"routes": [
|
|
{
|
|
"id": "demo",
|
|
"path_prefix": "/",
|
|
"backend_id": "demo",
|
|
"enabled": true,
|
|
"headers": {
|
|
"request": [
|
|
{
|
|
"op": "set",
|
|
"name": "x-rustproxy-example",
|
|
"value": "route"
|
|
}
|
|
],
|
|
"response": [
|
|
{
|
|
"op": "set",
|
|
"name": "x-rustproxy-demo",
|
|
"value": "enabled"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"id": "blocked-admin",
|
|
"path_prefix": "/admin",
|
|
"backend_id": "demo",
|
|
"enabled": true,
|
|
"acl": {
|
|
"default": "deny",
|
|
"rules": []
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"id": "example-3",
|
|
"frontend": {
|
|
"hosts": [
|
|
"demo.localhost"
|
|
],
|
|
"listener_ids": [
|
|
"example-1-http"
|
|
]
|
|
},
|
|
"backends": [
|
|
{
|
|
"id": "demo",
|
|
"url": "http://127.0.0.1:9000",
|
|
"allow_private": true,
|
|
"preserve_host": true
|
|
}
|
|
],
|
|
"load_balancing": {
|
|
"health_check": {
|
|
"mode": "off"
|
|
}
|
|
},
|
|
"routes": [
|
|
{
|
|
"id": "demo",
|
|
"path_prefix": "/",
|
|
"backend_id": "demo",
|
|
"enabled": true,
|
|
"headers": {
|
|
"request": [
|
|
{
|
|
"op": "set",
|
|
"name": "x-rustproxy-example",
|
|
"value": "route"
|
|
}
|
|
],
|
|
"response": [
|
|
{
|
|
"op": "set",
|
|
"name": "x-rustproxy-demo",
|
|
"value": "enabled"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"id": "blocked-admin",
|
|
"path_prefix": "/admin",
|
|
"backend_id": "demo",
|
|
"enabled": true,
|
|
"acl": {
|
|
"default": "deny",
|
|
"rules": []
|
|
}
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"listeners": {
|
|
"endpoints": [
|
|
{
|
|
"id": "example-1-http",
|
|
"name": "example-1 HTTP",
|
|
"scope": "internal",
|
|
"enabled": true,
|
|
"binding": {
|
|
"address": "127.0.0.1:8080",
|
|
"tls": false,
|
|
"http2": false,
|
|
"http3": null
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|