Nginx TCP forwarding based on hostname
<p>With the release of TCP load balancing for the Nginx community version, I would like to mix OpenVPN and SSL pass-through data. The only way for Nginx to know how to route the traffic is via their domain name.</p>

<pre><code> vpn1.app.com ─┬─► nginx at 10.0.0.1 ─┬─► vpn1  at 10.0.0.3
 vpn2.app.com ─┤                      ├─► vpn2  at 10.0.0.4
https.app.com ─┘                      └─► https at 10.0.0.5
</code></pre>

<p>I have taken a look at the <a href="https://www.nginx.com/resources/admin-guide/tcp-load-balancing/" rel="noreferrer">TCP guides</a> and the <a href="http://nginx.org/en/docs/stream/ngx_stream_core_module.html?_ga=1.74120594.1237357975.1452565611" rel="noreferrer">module documentation</a>, but it doesn't seem well referenced. If anyone can point me to the right direction, i'd be grateful.</p>

<p>Related question on ServerFault: <a href="https://serverfault.com/questions/625362/can-a-reverse-proxy-use-sni-with-ssl-pass-through">Can a Reverse Proxy use SNI with SSL pass through?</a></p>