# Ansible Managed: DO NOT EDIT
# Конфигурация для {{ item.stream }}

upstream {{ item.stream }}_backend {
    {% for server in item.backends %}
    server {{ server }};
    {% endfor %}
}

server {
    listen {{ item.listen_port }}{% if item.protocol == 'udp' %} udp{% endif %};
    proxy_pass {{ item.stream }}_backend;
    {% if item.transparent | default(false) %}
    proxy_bind $remote_addr transparent;
    {% endif %}
    {% if item.responses is defined %}
    proxy_responses {{ item.responses }};
    {% endif %}
    {% if item.timeout is defined %}
    proxy_timeout {{ item.timeout }};
    {% endif %}
    {%- if item.connect_timeout is defined %}
    proxy_connect_timeout {{ item.connect_timeout }};
    {% endif %}
}
