I have a fleet of Ubuntu edge computers that host simple web HMI servers. Many are behind dynamic IPs where port forwarding is unavailable.
So, to access them each uses autossh to create a reverse tunnel into a central cloud proxy server. I can then access each one with https://proxy.mydomain.com:6001, 6002, etc. This is working.
I now want to use NGINX so that we don't have to remember the port numbers. So, each facility would have it's own subdomain: https://site1.mydomain.com, site2, etc. All subdomains would point to my proxy server. NGINX should then look at the subdomain, and proxy https traffic to the appropriate reverse tunnel port.
NGINX config is shown below.
My issue at this point is that NGINX wants me to define an SSL certificate. However, I would like to use the certificates already installed on each of the edge computers.
So, how would I go about passing those certificates through the NGINX proxy to the client?
If this isn't possible - whats the best way to define one or separate certificates on the proxy server that can be used for all of the sub-domains?
server {
listen 443 ssl;
server_name site1.mydomain.com;
location / {
proxy_set_header Host $host;
proxy_pass https://127.0.0.1:6001;
proxy_ssl_server_name on;
proxy_redirect off;
}
}
server {
listen 443 ssl;
server_name site2.mydomain.com;
location / {
proxy_set_header Host $host;
proxy_pass https://127.0.0.1:6002;
proxy_ssl_server_name on;
proxy_redirect off;
}
}
UPDATE
To those curious, I was able to use the "SNIProxy" project instead of NGINX and solved this issue. HTTPS certs passed through with no problem.