Files
learn-devops/docker/nginx.tmpl
github-actions[bot] d6db5a4e6a Update docker readme (#17)
Co-authored-by: Fedor Batonogov <f.batonogov@yandex.ru>
2024-10-08 16:40:51 +03:00

23 lines
437 B
Cheetah

{{ range $host, $containers := groupBy $ "Env.VIRTUAL_HOST" }}
upstream {{ $host }} {
{{ range $index, $value := $containers }}
{{ with $address := index $value.Addresses 0 }}
server {{ $value.Hostname }}:{{ $address.Port }};
{{ end }}
{{ end }}
}
# конфигурация веб-сервера
server {
listen 8080;
server_tokens off;
location / {
proxy_pass http://{{ $host }};
}
}
{{ end }}