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
|
|
|
|
2023-02-26 08:34:27 +08:00
|
|
|
request_buffers 4KB
|
2020-10-31 02:05:21 +08:00
|
|
|
|
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
|
2023-02-07 03:44:11 +08:00
|
|
|
|
2022-07-09 01:04:22 +08:00
|
|
|
tls_renegotiation freely
|
|
|
|
tls_except_ports 8181 8182
|
2020-08-01 01:30:20 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
----------
|
|
|
|
{
|
|
|
|
"apps": {
|
|
|
|
"http": {
|
|
|
|
"servers": {
|
|
|
|
"srv0": {
|
|
|
|
"listen": [
|
|
|
|
":443"
|
|
|
|
],
|
|
|
|
"routes": [
|
|
|
|
{
|
|
|
|
"match": [
|
|
|
|
{
|
|
|
|
"host": [
|
|
|
|
"example.com"
|
|
|
|
]
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"handle": [
|
|
|
|
{
|
|
|
|
"handler": "subroute",
|
|
|
|
"routes": [
|
|
|
|
{
|
|
|
|
"handle": [
|
|
|
|
{
|
|
|
|
"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
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2023-02-26 08:34:27 +08:00
|
|
|
"request_buffers": 4000,
|
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-06-10 23:33:35 +08:00
|
|
|
"tls": {
|
2022-06-21 01:51:42 +08:00
|
|
|
"except_ports": [
|
|
|
|
"8181",
|
|
|
|
"8182"
|
|
|
|
],
|
2022-06-10 23:33:35 +08:00
|
|
|
"renegotiation": "freely"
|
|
|
|
},
|
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
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|