Routing based on ALPN

Konstantin Pavlov thresh at nginx.com
Mon Feb 19 13:14:51 UTC 2018


On 19/02/2018 14:02, Wiktor Kwapisiewicz via nginx wrote:
> Hello,
> 
> I'm looking for a way to route traffic on port 443 based on ALPN value
> without SSL termination.
> 
> ssl_preread_module [1] does something similar but the only exposed
> variable ($ssl_preread_server_name) is for SNI, not ALPN.
> 
> A bit of context. I'd like to use nginx to host regular HTTPS server on port
> 443 but if the ALPN value is 'xmpp-client' transparently proxy the traffic
> to my local Jabber server. This feature [2] is already supported by several
> XMPP clients.
> 
> Is there a way to access and save ALPN value to a variable?

It should possible to parse the incoming buffer with https://nginx.org/r/js_filter and create a variable to make a routing decision on.

-- 
Konstantin Pavlov
www.nginx.com


More information about the nginx mailing list