@@ -79,6 +79,13 @@ const (
79
79
// DefaultUpstreamTimeout represents the default connect,
80
80
// read and send timeout (in seconds) with upstreams.
81
81
DefaultUpstreamTimeout = 60
82
+
83
+ // PassHostPass represents pass option for pass_host Upstream settings.
84
+ PassHostPass = "pass"
85
+ // PassHostPass represents node option for pass_host Upstream settings.
86
+ PassHostNode = "node"
87
+ // PassHostPass represents rewrite option for pass_host Upstream settings.
88
+ PassHostRewrite = "rewrite"
82
89
)
83
90
84
91
var ValidSchemes map [string ]struct {} = map [string ]struct {}{
@@ -196,15 +203,17 @@ func (p *Plugins) DeepCopy() *Plugins {
196
203
type Upstream struct {
197
204
Metadata `json:",inline" yaml:",inline"`
198
205
199
- Type string `json:"type,omitempty" yaml:"type,omitempty"`
200
- HashOn string `json:"hash_on,omitempty" yaml:"hash_on,omitempty"`
201
- Key string `json:"key,omitempty" yaml:"key,omitempty"`
202
- Checks * UpstreamHealthCheck `json:"checks,omitempty" yaml:"checks,omitempty"`
203
- Nodes UpstreamNodes `json:"nodes" yaml:"nodes"`
204
- Scheme string `json:"scheme,omitempty" yaml:"scheme,omitempty"`
205
- Retries * int `json:"retries,omitempty" yaml:"retries,omitempty"`
206
- Timeout * UpstreamTimeout `json:"timeout,omitempty" yaml:"timeout,omitempty"`
207
- TLS * ClientTLS `json:"tls,omitempty" yaml:"tls,omitempty"`
206
+ Type string `json:"type,omitempty" yaml:"type,omitempty"`
207
+ HashOn string `json:"hash_on,omitempty" yaml:"hash_on,omitempty"`
208
+ Key string `json:"key,omitempty" yaml:"key,omitempty"`
209
+ Checks * UpstreamHealthCheck `json:"checks,omitempty" yaml:"checks,omitempty"`
210
+ Nodes UpstreamNodes `json:"nodes" yaml:"nodes"`
211
+ Scheme string `json:"scheme,omitempty" yaml:"scheme,omitempty"`
212
+ Retries * int `json:"retries,omitempty" yaml:"retries,omitempty"`
213
+ Timeout * UpstreamTimeout `json:"timeout,omitempty" yaml:"timeout,omitempty"`
214
+ TLS * ClientTLS `json:"tls,omitempty" yaml:"tls,omitempty"`
215
+ PassHost string `json:"pass_host,omitempty" yaml:"pass_host,omitempty"`
216
+ UpstreamHost string `json:"upstream_host,omitempty" yaml:"upstream_host,omitempty"`
208
217
209
218
// for Service Discovery
210
219
ServiceName string `json:"service_name,omitempty" yaml:"service_name,omitempty"`
@@ -271,10 +280,12 @@ func (up Upstream) MarshalJSON() ([]byte, error) {
271
280
Key string `json:"key,omitempty" yaml:"key,omitempty"`
272
281
Checks * UpstreamHealthCheck `json:"checks,omitempty" yaml:"checks,omitempty"`
273
282
//Nodes UpstreamNodes `json:"nodes" yaml:"nodes"`
274
- Scheme string `json:"scheme,omitempty" yaml:"scheme,omitempty"`
275
- Retries * int `json:"retries,omitempty" yaml:"retries,omitempty"`
276
- Timeout * UpstreamTimeout `json:"timeout,omitempty" yaml:"timeout,omitempty"`
277
- TLS * ClientTLS `json:"tls,omitempty" yaml:"tls,omitempty"`
283
+ Scheme string `json:"scheme,omitempty" yaml:"scheme,omitempty"`
284
+ Retries * int `json:"retries,omitempty" yaml:"retries,omitempty"`
285
+ Timeout * UpstreamTimeout `json:"timeout,omitempty" yaml:"timeout,omitempty"`
286
+ HostPass string `json:"pass_host,omitempty" yaml:"pass_host,omitempty"`
287
+ UpstreamHost string `json:"upstream_host,omitempty" yaml:"upstream_host,omitempty"`
288
+ TLS * ClientTLS `json:"tls,omitempty" yaml:"tls,omitempty"`
278
289
279
290
// for Service Discovery
280
291
ServiceName string `json:"service_name,omitempty" yaml:"service_name,omitempty"`
@@ -288,10 +299,12 @@ func (up Upstream) MarshalJSON() ([]byte, error) {
288
299
Key : up .Key ,
289
300
Checks : up .Checks ,
290
301
//Nodes: up.Nodes,
291
- Scheme : up .Scheme ,
292
- Retries : up .Retries ,
293
- Timeout : up .Timeout ,
294
- TLS : up .TLS ,
302
+ Scheme : up .Scheme ,
303
+ Retries : up .Retries ,
304
+ Timeout : up .Timeout ,
305
+ HostPass : up .PassHost ,
306
+ UpstreamHost : up .UpstreamHost ,
307
+ TLS : up .TLS ,
295
308
296
309
ServiceName : up .ServiceName ,
297
310
DiscoveryType : up .DiscoveryType ,
@@ -301,15 +314,17 @@ func (up Upstream) MarshalJSON() ([]byte, error) {
301
314
return json .Marshal (& struct {
302
315
Metadata `json:",inline" yaml:",inline"`
303
316
304
- Type string `json:"type,omitempty" yaml:"type,omitempty"`
305
- HashOn string `json:"hash_on,omitempty" yaml:"hash_on,omitempty"`
306
- Key string `json:"key,omitempty" yaml:"key,omitempty"`
307
- Checks * UpstreamHealthCheck `json:"checks,omitempty" yaml:"checks,omitempty"`
308
- Nodes UpstreamNodes `json:"nodes" yaml:"nodes"`
309
- Scheme string `json:"scheme,omitempty" yaml:"scheme,omitempty"`
310
- Retries * int `json:"retries,omitempty" yaml:"retries,omitempty"`
311
- Timeout * UpstreamTimeout `json:"timeout,omitempty" yaml:"timeout,omitempty"`
312
- TLS * ClientTLS `json:"tls,omitempty" yaml:"tls,omitempty"`
317
+ Type string `json:"type,omitempty" yaml:"type,omitempty"`
318
+ HashOn string `json:"hash_on,omitempty" yaml:"hash_on,omitempty"`
319
+ Key string `json:"key,omitempty" yaml:"key,omitempty"`
320
+ Checks * UpstreamHealthCheck `json:"checks,omitempty" yaml:"checks,omitempty"`
321
+ Nodes UpstreamNodes `json:"nodes" yaml:"nodes"`
322
+ Scheme string `json:"scheme,omitempty" yaml:"scheme,omitempty"`
323
+ Retries * int `json:"retries,omitempty" yaml:"retries,omitempty"`
324
+ Timeout * UpstreamTimeout `json:"timeout,omitempty" yaml:"timeout,omitempty"`
325
+ HostPass string `json:"pass_host,omitempty" yaml:"pass_host,omitempty"`
326
+ UpstreamHost string `json:"upstream_host,omitempty" yaml:"upstream_host,omitempty"`
327
+ TLS * ClientTLS `json:"tls,omitempty" yaml:"tls,omitempty"`
313
328
314
329
// for Service Discovery
315
330
//ServiceName string `json:"service_name,omitempty" yaml:"service_name,omitempty"`
@@ -318,15 +333,17 @@ func (up Upstream) MarshalJSON() ([]byte, error) {
318
333
}{
319
334
Metadata : up .Metadata ,
320
335
321
- Type : up .Type ,
322
- HashOn : up .HashOn ,
323
- Key : up .Key ,
324
- Checks : up .Checks ,
325
- Nodes : up .Nodes ,
326
- Scheme : up .Scheme ,
327
- Retries : up .Retries ,
328
- Timeout : up .Timeout ,
329
- TLS : up .TLS ,
336
+ Type : up .Type ,
337
+ HashOn : up .HashOn ,
338
+ Key : up .Key ,
339
+ Checks : up .Checks ,
340
+ Nodes : up .Nodes ,
341
+ Scheme : up .Scheme ,
342
+ Retries : up .Retries ,
343
+ Timeout : up .Timeout ,
344
+ HostPass : up .PassHost ,
345
+ UpstreamHost : up .UpstreamHost ,
346
+ TLS : up .TLS ,
330
347
331
348
//ServiceName: up.ServiceName,
332
349
//DiscoveryType: up.DiscoveryType,
0 commit comments