2020-08-01 01:30:20 +08:00
|
|
|
|
|
|
|
https://example.com {
|
2022-05-06 22:50:26 +08:00
|
|
|
reverse_proxy /path https://localhost:54321 {
|
|
|
|
header_up Host {upstream_hostport}
|
|
|
|
header_up Foo bar
|
|
|
|
|
|
|
|
method GET
|
|
|
|
rewrite /rewritten?uri={uri}
|
2020-10-31 02:05:21 +08:00
|
|
|
|
|
|
|
buffer_requests
|
|
|
|
|
2020-08-01 01:30:20 +08:00
|
|
|
transport http {
|
2020-11-03 05:59:02 +08:00
|
|
|
read_buffer 10MB
|
|
|
|
write_buffer 20MB
|
|
|
|
max_response_header 30MB
|
|
|
|
dial_timeout 3s
|
|
|
|
dial_fallback_delay 5s
|
|
|
|
response_header_timeout 8s
|
|
|
|
expect_continue_timeout 9s
|
2022-03-07 08:43:39 +08:00
|
|
|
resolvers 8.8.8.8 8.8.4.4
|
2020-11-03 05:59:02 +08:00
|
|
|
|
2020-08-01 01:30:20 +08:00
|
|
|
versions h2c 2
|
|
|
|
compression off
|
2020-10-31 02:05:21 +08:00
|
|
|
max_conns_per_host 5
|
2021-06-16 05:02:22 +08:00
|
|
|
keepalive_idle_conns_per_host 2
|
2021-11-24 14:32:25 +08:00
|
|
|
keepalive_interval 30s
|
2020-08-01 01:30:20 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
----------
|
|
|
|
{
|
|
|
|
"apps": {
|
|
|
|
"http": {
|
|
|
|
"servers": {
|
|
|
|
"srv0": {
|
|
|
|
"listen": [
|
|
|
|
":443"
|
|
|
|
],
|
|
|
|
"routes": [
|
|
|
|
{
|
|
|
|
"match": [
|
|
|
|
{
|
|
|
|
"host": [
|
|
|
|
"example.com"
|
|
|
|
]
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"handle": [
|
|
|
|
{
|
|
|
|
"handler": "subroute",
|
|
|
|
"routes": [
|
|
|
|
{
|
|
|
|
"handle": [
|
|
|
|
{
|
2020-09-09 00:37:46 +08:00
|
|
|
"buffer_requests": true,
|
2020-08-01 01:30:20 +08:00
|
|
|
"handler": "reverse_proxy",
|
|
|
|
"headers": {
|
|
|
|
"request": {
|
|
|
|
"set": {
|
2022-05-06 22:50:26 +08:00
|
|
|
"Foo": [
|
|
|
|
"bar"
|
2020-08-01 01:30:20 +08:00
|
|
|
],
|
2022-05-06 22:50:26 +08:00
|
|
|
"Host": [
|
|
|
|
"{http.reverse_proxy.upstream.hostport}"
|
2020-08-01 01:30:20 +08:00
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2022-05-06 22:50:26 +08:00
|
|
|
"rewrite": {
|
|
|
|
"method": "GET",
|
|
|
|
"uri": "/rewritten?uri={http.request.uri}"
|
|
|
|
},
|
2020-08-01 01:30:20 +08:00
|
|
|
"transport": {
|
|
|
|
"compression": false,
|
2020-11-03 05:59:02 +08:00
|
|
|
"dial_fallback_delay": 5000000000,
|
|
|
|
"dial_timeout": 3000000000,
|
|
|
|
"expect_continue_timeout": 9000000000,
|
2021-06-16 05:02:22 +08:00
|
|
|
"keep_alive": {
|
2021-11-24 14:32:25 +08:00
|
|
|
"max_idle_conns_per_host": 2,
|
|
|
|
"probe_interval": 30000000000
|
2021-06-16 05:02:22 +08:00
|
|
|
},
|
2020-10-31 02:05:21 +08:00
|
|
|
"max_conns_per_host": 5,
|
2020-11-03 05:59:02 +08:00
|
|
|
"max_response_header_size": 30000000,
|
2020-08-01 01:30:20 +08:00
|
|
|
"protocol": "http",
|
2020-11-03 05:59:02 +08:00
|
|
|
"read_buffer_size": 10000000,
|
2022-03-07 08:43:39 +08:00
|
|
|
"resolver": {
|
|
|
|
"addresses": [
|
|
|
|
"8.8.8.8",
|
|
|
|
"8.8.4.4"
|
|
|
|
]
|
|
|
|
},
|
2020-11-03 05:59:02 +08:00
|
|
|
"response_header_timeout": 8000000000,
|
2022-05-06 22:50:26 +08:00
|
|
|
"tls": {},
|
2020-08-01 01:30:20 +08:00
|
|
|
"versions": [
|
|
|
|
"h2c",
|
|
|
|
"2"
|
2020-11-03 05:59:02 +08:00
|
|
|
],
|
|
|
|
"write_buffer_size": 20000000
|
2020-08-01 01:30:20 +08:00
|
|
|
},
|
|
|
|
"upstreams": [
|
|
|
|
{
|
|
|
|
"dial": "localhost:54321"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"match": [
|
|
|
|
{
|
|
|
|
"path": [
|
|
|
|
"/path"
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"terminal": true
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|