-
Notifications
You must be signed in to change notification settings - Fork 2
/
config.yaml
139 lines (130 loc) · 3.17 KB
/
config.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
# pingora config example from https://github.com/cloudflare/pingora/blob/main/docs/user_guide/conf.md
pingora:
version: 1
threads: 2
pid_file: /run/pingora.pid
upgrade_sock: /tmp/pingora_upgrade.sock
user: nobody
group: webusers
pingsix:
# listener on TCP or TLS
listeners:
- address: 0.0.0.0:8080
# - address: "[::1]:443"
# tls:
# cert_path: /etc/ssl/server.crt
# key_path: /etc/ssl/server.key
# offer_h2: true
etcd:
host:
- "http://192.168.2.141:2379"
prefix: /apisix
admin:
address: "0.0.0.0:8082"
api_key: pingsix
prometheus:
address: 0.0.0.0:8081
sentry:
dsn: https://1234567890@sentry.io/123456
# api routes example for https://apisix.apache.org/docs/apisix/admin-api/#route
# Here is a complete example, which is a subset of routes from the apisix docs. The fields not mentioned here indicate that pingsix does not support them.
# The fields in the following comments are all optional parameters.
routes:
- id: 1
uri: /
# uris: ["/","/test"]
host: www.baidu.com
# hosts: ["www.baidu.com","www.taobao.com"]
# methods: ["GET", "POST"]
# timeout:
# connect: 2
# send: 3
# read: 5
# priority: 10
upstream: # Field description https://apisix.apache.org/docs/apisix/admin-api/#upstream
# id: 1
# retries: 2
# retry_timeout: 10
nodes:
"www.baidu.com": 1
type: roundrobin # supported types: roundrobin, random, fnv, ketama
# timeout:
# connect: 2
# send: 3
# read: 5
checks: # Field description https://apisix.apache.org/docs/apisix/tutorials/health-check/
active: # only support active check
type: https
timeout: 1
host: www.baidu.com
http_path: /
# port: 8443
https_verify_certificate: true
req_headers: ["User-Agent: curl/7.29.0"]
healthy:
interval: 5
http_statuses: [200, 201]
successes: 2
unhealthy:
http_failures: 5
tcp_failures: 2
hash_on: vars # supported types: vars, cookie, head
key: uri
pass_host: rewrite
upstream_host: www.baidu.com
scheme: https
- id: 2
uri: /
host: www.taobao.com
upstream_id: 1
- id: 3
uri: /
service_id: 1
- id: 4
uri: /
host: www.163.com
service_id: 2
- id: 5
uri: /echo
host: www.163.com
service_id: 2
plugins:
echo:
body: "Hello world!"
headers:
X-TEST: demo
upstreams:
- id: 1
nodes:
"www.taobao.com": 1
type: roundrobin
pass_host: rewrite
upstream_host: www.taobao.com
scheme: http
- id: 2
nodes:
"www.qq.com": 1
type: roundrobin
scheme: http
services:
- id: 1
hosts: ["www.qq.com"]
upstream_id: 2
- id: 2
upstream:
nodes:
"www.163.com": 1
type: roundrobin
scheme: http
plugins:
limit-count:
key_type: head
key: Host
time_window: 1
count: 1
rejected_code: 429
rejected_msg: "Pleas slow down!"
global_rules:
- id: 1
plugins:
prometheus: {}