# ------------------------------------------------------------ # SSL Passthrough hosts # ------------------------------------------------------------ map $ssl_preread_server_name $name { {% for host in all_passthrough_hosts %} {% if enabled %} {{ host.domain_name }} ssl_passthrough_{{ host.escaped_name }} {% endif %} {% endfor %} default https_default_backend; } {% for host in all_passthrough_hosts %} {% if enabled %} upstream ssl_passthrough_{{ host.escaped_name }} { server {{host.forwarding_host}}:{{host.forwarding_port}}; } {% endif %} {% endfor %} upstream https_default_backend { server 127.0.0.1:443; } server { listen 444; {% if ipv6 -%} listen [::]:444; {% else -%} #listen [::]:444; {% endif %} proxy_pass $name; ssl_preread on; # Custom include /data/nginx/custom/server_ssl_passthrough[.]conf; }