<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>Hi Louis</p>
    <p>The variable I think you're looking for is <span style="color:
        rgb(0, 0, 0); font-family: monospace; font-size: medium;
        font-style: normal; font-variant-ligatures: normal;
        font-variant-caps: normal; font-weight: 400; letter-spacing:
        normal; orphans: 2; text-align: left; text-indent: 0px;
        text-transform: none; white-space: normal; widows: 2;
        word-spacing: 0px; -webkit-text-stroke-width: 0px;
        background-color: rgb(255, 255, 255); text-decoration-style:
        initial; text-decoration-color: initial; display: inline
        !important; float: none;">$host - </span><span style="color:
        rgb(0, 0, 0); font-family: monospace; font-size: medium;
        font-style: normal; font-variant-ligatures: normal;
        font-variant-caps: normal; font-weight: 400; letter-spacing:
        normal; orphans: 2; text-align: left; text-indent: 0px;
        text-transform: none; white-space: normal; widows: 2;
        word-spacing: 0px; -webkit-text-stroke-width: 0px;
        background-color: rgb(255, 255, 255); text-decoration-style:
        initial; text-decoration-color: initial; display: inline
        !important; float: none;"><a
          href="http://nginx.org/en/docs/http/ngx_http_core_module.html#variables">http://nginx.org/en/docs/http/ngx_http_core_module.html#variables</a></span></p>
    <div class="moz-signature"><br>
    </div>
    <div class="moz-cite-prefix">On 8/26/19 8:55 PM, Louis Garcia wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAFiZx5y4iugmSGsTLgxCXRtU81suUBg7ipC2755g+y4fbSWESA@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">
        <div>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.</div>
        <div>Thanks.<br>
        </div>
        <div><br>
        </div>
        <div>stream {<br>
                  map $ssl_preread_server_name $name {<br>
                                                     
          plex.montclaire.lan app1;<br>
                                                     
          transmission.montclaire.lan app2;<br>
                                                      default default;<br>
                                                     }<br>
                  upstream app1 {<br>
                                 server <a
            href="http://127.0.0.1:32400" moz-do-not-send="true">127.0.0.1:32400</a>
          max_fails=3 fail_timeout=10s;<br>
                                }</div>
        <div>        upstream app2 {<br>
                                 server <a href="http://127.0.0.1:9091"
            moz-do-not-send="true">127.0.0.1:9091</a> max_fails=3
          fail_timeout=10s;<br>
                                }</div>
        <div>        server {</div>
        <div>                listen <a href="http://172.16.0.5:80"
            moz-do-not-send="true">172.16.0.5:80</a>;<br>
        </div>
        <div>                listen <a href="http://172.16.0.5:443"
            moz-do-not-send="true">172.16.0.5:443</a>;<br>
                          proxy_pass $name;<br>
                          ssl_preread on;<br>
                         }<br>
                 }<br>
          <br>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
nginx mailing list
<a class="moz-txt-link-abbreviated" href="mailto:nginx@nginx.org">nginx@nginx.org</a>
<a class="moz-txt-link-freetext" href="http://mailman.nginx.org/mailman/listinfo/nginx">http://mailman.nginx.org/mailman/listinfo/nginx</a></pre>
    </blockquote>
  </body>
</html>