Files
learn-devops/docker/nginx.tmpl
github-actions[bot] 99088532f2 Add docker (#6)
* Add docker

* Update example

---------

Co-authored-by: Fedor Batonogov <f.batonogov@yandex.ru>
2024-04-27 15:53:50 +03:00

21 lines
411 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 80;
location / {
proxy_pass http://{{ $host }};
}
}
{{ end }}