mirror of
https://gitee.com/rainbond/Rainbond.git
synced 2024-12-01 03:07:51 +08:00
f1dd2384ed
fix bug that Ingress was unable to remove all when the component was closed;
28 lines
985 B
Cheetah
28 lines
985 B
Cheetah
# TCP services
|
|
{{ range $tcpServer := .TCPBackends }}
|
|
server {
|
|
preread_by_lua_block {
|
|
ngx.var.proxy_upstream_name="{{ $tcpServer.UpstreamName }}";
|
|
}
|
|
|
|
{{ if .Listen }}listen {{.Listen}} {{ if $tcpServer.ProxyProtocol.Decode }} proxy_protocol{{ end }};{{ end }}
|
|
proxy_timeout {{ $tcpServer.ProxyStreamTimeout }};
|
|
proxy_pass upstream_balancer;
|
|
{{ if $tcpServer.ProxyProtocol.Encode }}
|
|
proxy_protocol on;
|
|
{{ end }}
|
|
}
|
|
{{ end }}
|
|
|
|
# UDP services
|
|
{{ range $udpServer := .UDPBackends }}
|
|
server {
|
|
preread_by_lua_block {
|
|
ngx.var.proxy_upstream_name="{{ $udpServer.UpstreamName }}";
|
|
}
|
|
{{ if $udpServer.Listen }}listen {{$udpServer.Listen}} {{ if $udpServer.ProxyProtocol.Decode }} proxy_protocol{{ end }};{{ end }}
|
|
proxy_responses {{ $udpServer.ProxyStreamResponses }};
|
|
proxy_timeout {{ $udpServer.ProxyStreamTimeout }};
|
|
proxy_pass upstream_balancer;
|
|
}
|
|
{{ end }} |