mirror of https://github.com/k3d-io/k3d
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
1.0 KiB
43 lines
1.0 KiB
###################################
|
|
# Generated by confd {{datetime}} #
|
|
# ####### #
|
|
# # k3d # #
|
|
# ####### #
|
|
###################################
|
|
|
|
error_log stderr notice;
|
|
|
|
worker_processes auto;
|
|
events {
|
|
multi_accept on;
|
|
use epoll;
|
|
worker_connections {{ getv "/settings/workerConnections" }};
|
|
}
|
|
|
|
stream {
|
|
|
|
{{- range $portstring := lsdir "/ports" }}
|
|
|
|
|
|
{{- $portdir := printf "/ports/%s/*" $portstring -}}
|
|
{{- $port := index (split $portstring ".") 0 -}}
|
|
{{- $protocol := index (split $portstring ".") 1 -}}
|
|
{{- $upstream := replace $portstring "." "_" -1 }}
|
|
|
|
upstream {{ $upstream }} {
|
|
{{- range $server := getvs $portdir }}
|
|
server {{ $server }}:{{ $port }} max_fails=1 fail_timeout=10s;
|
|
{{- end }}
|
|
}
|
|
|
|
server {
|
|
listen {{ $port }} {{- if (eq $protocol "udp") }} udp{{- end -}};
|
|
proxy_pass {{ $upstream }};
|
|
proxy_timeout {{ getv "/settings/defaultProxyTimeout" "600" }};
|
|
proxy_connect_timeout 2s;
|
|
}
|
|
|
|
|
|
{{- end }}
|
|
|
|
}
|
|
|