# ------------------------------------------------------------ # {{ incoming_port }} TCP: {{ tcp_forwarding }} UDP: {{ udp_forwarding }} # ------------------------------------------------------------ {% if proxy_protocol_enabled == 1 or proxy_protocol_enabled == true -%} {% capture listen_extra_args %}proxy_protocol{% endcapture -%} {% endif -%} {% if enabled %} {% if tcp_forwarding == 1 or tcp_forwarding == true -%} server { listen {{ incoming_port }} {{ listen_extra_args }}; {% if ipv6 -%} listen [::]:{{ incoming_port }} {{ listen_extra_args }}; {% else -%} #listen [::]:{{ incoming_port }}{{ listen_extra_args }}; {% endif %} proxy_pass {{ forwarding_host }}:{{ forwarding_port }}; {% include '_proxy_protocol.conf' %} # Custom include /data/nginx/custom/server_stream[.]conf; include /data/nginx/custom/server_stream_tcp[.]conf; } {% endif %} {% if udp_forwarding == 1 or udp_forwarding == true %} {% # Proxy Protocol is not supported for UDP %} {% assign listen_extra_args = "" %} server { listen {{ incoming_port }} udp {{ listen_extra_args }}; {% if ipv6 -%} listen [::]:{{ incoming_port }} udp {{ listen_extra_args }}; {% else -%} #listen [::]:{{ incoming_port }} udp {{ listen_extra_args }}; {% endif %} proxy_pass {{ forwarding_host }}:{{ forwarding_port }}; # Custom include /data/nginx/custom/server_stream[.]conf; include /data/nginx/custom/server_stream_udp[.]conf; } {% endif %} {% endif %}