This repository has been archived by the owner on Sep 16, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 25
/
sample.cfg
193 lines (163 loc) · 3.45 KB
/
sample.cfg
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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
daemonize = false
#logging {
# general {
# output = "file:/dev/stdout"
# level = error
# }
#}
server {
addr = 0.0.0.0
port = 7070
backlog = 1024
threads = 1
read-timeout = { 2, 0 }
write-timeout = { 0, 0 }
pending-timeout = { 10, 0 }
max-pending = 200
high-watermark = 5242880
downstream ds_01 {
addr = 127.0.0.1
port = 8081
connections = 10
high-watermark = 0
read-timeout = { 0, 0 }
write-timeout = { 0, 0 }
retry = { 1, 50000 }
}
downstream ds_02 {
addr = 127.0.0.1
port = 8082
connections = 10
retry = { 1, 50000 }
}
downstream ds_03 {
addr = 127.0.0.1
port = 8083
connections = 10
retry = { 1, 50000 }
}
downstream ds_04 {
addr = 127.0.0.1
port = 80
connections = 10
retry = { 1, 50000 }
}
downstream passthru_test {
addr = 127.0.0.1
port = 9095
connections = 2
retry = { 1, 50000 }
}
downstream default_downstream {
enabled = true
addr = 127.0.0.1
port = 8084
}
ssl {
enabled = false
cert = ./server.crt
key = ./server.key
}
logging {
error {
enabled = true
level = error
output = "file:/dev/stdout"
}
}
vhost "localhost*" {
aliases = { "172.21.*", 127.0.0.1, box.local }
strip-headers = { "foobar" }
ssl {
enabled = true
protocols-on = { TLSv1, SSLv3 }
protocols-off = { SSLv3 }
cert = ./server.crt
key = ./server.key
verify-peer = true
verify-depth = 4
cache-enabled = false
}
rule test_passthrough {
uri-match = "/ownme"
passthrough = true
downstreams = { passthru_test }
}
rule test_redirect {
uri-match = "/redir"
allow-redirect = true
downstreams = { ds_01 }
}
rule test_redirect_filter {
uri-match = "/redir_filter"
allow-redirect = true
redirect-filter = { "localhost*", "*ieatfood.net*", "blerp*" }
downstreams = { ds_01 }
}
rule derp {
uri-gmatch = "*/file*"
downstreams = { ds_04 }
}
rule test_1 {
uri-match = "/ugh"
downstreams = { ds_04 }
# set rule-specific connection read/write timeout to infinity
upstream-read-timeout = { 1, 0 }
upstream-write-timeout = { 0, 0 }
}
rule test_2 {
uri-match = "/poll"
downstreams = { ds_01, ds_02 }
lb-method = roundrobin
upstream-read-timeout = { 10, 0 }
headers {
x-forwarded-for = true
x-ssl-certificate = false
}
}
rule test_rmatch {
uri-rmatch = "^/things/(.*)"
downstreams = { ds_03 }
}
rule test_gmatch {
uri-gmatch = "/stuff/*"
downstreams = { ds_01, ds_02, ds_03 }
lb-method = roundrobin
}
rule default {
uri-gmatch = "*"
downstreams = { ds_01 }
}
logging {
request {
enabled = true
output = "file:/dev/stdout"
format = "{TS}: {RULE} {SRC} {HOST} {URI}"
}
error {
enabled = true
level = error
output = "file:/dev/stderr"
format = "{SRC} {HOST} {URI}"
}
}
}
vhost test.blah {
aliases = { test.blah.local }
ssl {
enabled = true
cert = ./server2.pem
cache-enabled = false
}
rule default {
uri-gmatch = "/*"
downstreams = { ds_01 }
}
logging {
error {
enabled = true
output = "file:/dev/stdout"
format = "{SRC} {HOST} {URI}"
}
}
}