Little helper to run CNCF's k3s in Docker
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.
k3d/proxy/templates/nginx.tmpl

44 lines
1002 B

###################################
# Generated by confd {{datetime}} #
# ####### #
# # k3d # #
# ####### #
###################################
error_log stderr notice;
worker_processes auto;
events {
multi_accept on;
use epoll;
worker_connections {{ getv "/settings/workerProcesses" }};
}
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 600;
proxy_connect_timeout 2s;
}
{{- end }}
}