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.
Thanks.

stream {
        map $ssl_preread_server_name $name {
                                            plex.montclaire.lan app1;
                                            transmission.montclaire.lan
app2;
                                            default default;
                                           }
        upstream app1 {
                       server 127.0.0.1:32400 max_fails=3 fail_timeout=10s;
                      }
        upstream app2 {
                       server 127.0.0.1:9091 max_fails=3 fail_timeout=10s;
                      }
        server {
                listen 172.16.0.5:80;
                listen 172.16.0.5:443;
                proxy_pass $name;
                ssl_preread on;
               }
       }
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx

Reply via email to