[FIX] proxy: rename udp specific upstreams (#564)

Fixes #563
This commit is contained in:
Thorsten Klein 2021-04-15 18:30:59 +02:00 committed by GitHub
parent 70a00bed1d
commit 0519c8fe30
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 2 deletions

View File

@ -4,4 +4,5 @@ dest = "/etc/nginx/nginx.conf"
keys = [
"SERVERS",
"PORTS",
"UDP_PORTS",
]

View File

@ -11,6 +11,10 @@ events {
}
stream {
#######
# TCP #
#######
{{- range $port := $ports }}
upstream server_nodes_{{ $port }} {
{{- range $server := $servers }}
@ -25,9 +29,14 @@ stream {
proxy_connect_timeout 2s;
}
{{- end }}
#######
# UDP #
#######
{{- range $port := $udp_ports }}
{{- if $port }}
upstream server_nodes_{{ $port }} {
upstream server_nodes_udp_{{ $port }} {
{{- range $server := $servers }}
server {{ $server }}:{{ $port }} max_fails=1 fail_timeout=10s;
{{- end }}
@ -35,7 +44,7 @@ stream {
server {
listen {{ $port }} udp;
proxy_pass server_nodes_{{ $port }};
proxy_pass server_nodes_udp_{{ $port }};
proxy_timeout 600;
proxy_connect_timeout 2s;
}