# HG changeset patch # User Vladimir Homutov # Date 1521196622 -10800 # Node ID 9f7e12cf974f9064b708b7d136f590064313b249 # Parent dab82d534f0f195977d5766b0967812147f8de21 Documented the $ssl_preread_alpn_protocols variable. diff --git a/xml/en/docs/stream/ngx_stream_ssl_preread_module.xml b/xml/en/docs/stream/ngx_stream_ssl_preread_module.xml --- a/xml/en/docs/stream/ngx_stream_ssl_preread_module.xml +++ b/xml/en/docs/stream/ngx_stream_ssl_preread_module.xml @@ -9,7 +9,7 @@ + rev="2">
@@ -19,7 +19,9 @@ extracting information from the ClientHello message without terminating SSL/TLS, for example, the sever name requested through -SNI. +SNI +or protocols advertised in +ALPN. This module is not built by default, it should be enabled with the --with-stream_ssl_preread_module configuration parameter. @@ -31,6 +33,9 @@ configuration parameter.
+ +Selecting an upstream based on server name: + map $ssl_preread_server_name $name { backend.example.com backend; @@ -48,9 +53,25 @@ upstream backend2 { } server { - listen 12346; - proxy_pass $name; - ssl_preread on; + listen 12346; + proxy_pass $name; + ssl_preread on; +} + + +Selecting an upstream based on protocol: + + +map $ssl_preread_alpn_protocols $proxy { + ~\bh2\b 127.0.0.1:8001; + ~\bhttp/1.1\b 127.0.0.1:8002; + ~\bxmpp-client\b 127.0.0.1:8003; +} + +server { + listen 9000; + proxy_pass $proxy; + ssl_preread on; } @@ -84,7 +105,15 @@ the $ssl_preread_server_name -returns the server name requested through SNI +server name requested through SNI + + +$ssl_preread_alpn_protocols + +list of protocols advertised by the client through ALPN (1.13.10) + +The values are separated by commas. + diff --git a/xml/ru/docs/stream/ngx_stream_ssl_preread_module.xml b/xml/ru/docs/stream/ngx_stream_ssl_preread_module.xml --- a/xml/ru/docs/stream/ngx_stream_ssl_preread_module.xml +++ b/xml/ru/docs/stream/ngx_stream_ssl_preread_module.xml @@ -9,7 +9,7 @@ + rev="2">
@@ -19,7 +19,9 @@ ClientHello без терминирования SSL/TLS, например имя сервера, запрошенное через -SNI. +SNI +или протоколы указанные в +ALPN. По умолчанию этот модуль не собирается, его сборку необходимо разрешить с помощью конфигурационного параметра --with-stream_ssl_preread_module. @@ -31,6 +33,9 @@
+ +Выбор сервера по имени: + map $ssl_preread_server_name $name { backend.example.com backend; @@ -48,11 +53,28 @@ upstream backend2 { } server { - listen 12346; - proxy_pass $name; - ssl_preread on; + listen 12346; + proxy_pass $name; + ssl_preread on; } + +Выбор сервера по протоколу: + + +map $ssl_preread_alpn_protocols $proxy { + ~\bh2\b 127.0.0.1:8001; + ~\bhttp/1.1\b 127.0.0.1:8002; + ~\bxmpp-client\b 127.0.0.1:8003; +} + +server { + listen 9000; + proxy_pass $proxy; + ssl_preread on; +} + +
@@ -83,7 +105,15 @@ server { $ssl_preread_server_name -возвращает имя сервера, запрошенное через SNI +имя сервера, запрошенное через SNI + + +$ssl_preread_alpn_protocols + +список протоколов, переданный клиентом через ALPN (1.3.10) + +Значения разделены запятыми. +