SSL passtrough

Daniel Armando Rodriguez drodriguez at unau.edu.ar
Fri Jan 28 13:22:42 UTC 2022


Hi there

I have a RP in front of several services and now need to add SSL 
passtrough for some of them. So, with this goal set up this config

stream {
     map $ssl_preread_server_name $name {
     sub1.DOMAIN   sub1;
     sub2.DOMAIN   sub2;
     sub3.DOMAIN   sub3;
     sub4.DOMAIN   sub4;
  }

  upstream sub1 {
     server x.y.z.1:443;
  }

  upstream sub2 {
     server x.y.z.1:443;
  }

  upstream sub3 {
     server x.y.z.1:443;
  }

  upstream sub4 {
     server x.y.z.1:443;
  }

  server {
     listen 443;
     proxy_pass $name;
     ssl_preread on;
  }
}

And yes, four subdomains are hosted in the same VM. This has to do with 
the peculiarities of the software used.

In order to catch HTTP traffic, and redirect, add this to each subdomain 
server.

server {
   listen 80;
   return 301 https://$host$request_uri;
  }

Is this the right way to go or am I missing something?

Also tryied to upgrade nginx using Debian repo but wasn't possible. 
Currently installed 1.14.2 under Debian Buster




________________________________________________

  Daniel A. Rodriguez
_Informática, Conectividad y Sistemas_
Universidad Nacional del Alto Uruguay
San Vicente - Misiones - Argentina
informatica.unau.edu.ar



More information about the nginx mailing list