stream server name question

Louis Garcia louisgtwo at
Tue Aug 27 00:55:31 UTC 2019

I am able to use $ssl_preread_server_name to get the server name. This is
with https requests. Is there a corresponding embedded variable for http
requests? I would like to setup streams to different backend servers based
on http requests. Example below works for https but not http.

stream {
        map $ssl_preread_server_name $name {
                                            plex.montclaire.lan app1;
                                            default default;
        upstream app1 {
                       server max_fails=3 fail_timeout=10s;
        upstream app2 {
                       server max_fails=3 fail_timeout=10s;
        server {
                proxy_pass $name;
                ssl_preread on;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the nginx mailing list