mirror of
https://github.com/batonogov/learn-devops.git
synced 2025-11-29 08:43:01 +00:00
23 lines
437 B
Cheetah
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 }}
|