18 lines
591 B
Cheetah
18 lines
591 B
Cheetah
defaults
|
|
option redispatch
|
|
retries 5
|
|
maxconn 2000
|
|
contimeout 5000
|
|
clitimeout 50000
|
|
srvtimeout 50000
|
|
|
|
{{range $svc := ls "/registry/services/endpoints/default"}}
|
|
{{$se := printf "/registry/services/endpoints/default/%s" $svc }}{{$ss := printf "/registry/services/specs/default/%s" $svc }}
|
|
{{$seKey := get $se}}{{$ssKey := get $ss}}{{$seJson := json $seKey.Value}}{{$ssJson := json $ssKey.Value}}
|
|
listen {{base $svc}} 0.0.0.0:{{$ssJson.port}}
|
|
mode tcp
|
|
balance leastconn
|
|
{{range $index, $endpoint := $seJson.endpoints}}
|
|
server svr{{$index}} {{$endpoint}}{{end}}
|
|
{{end}}
|