Forward HTTPS traffic thru Nginx without SSL certificate

10,631

Solution 1

You're looking for ssl pass-through. You'll set up your nginx to use TCP load balancing (even if you only have one server it's still thought of as load balancing) and ssl passthrough. Note that nginx will be unable to access any of the content and that you will lose almost all of the advantages of using a proxy other than the ability to do load balancing. See these instructions for a specific configuration example.

Solution 2

You can configure nginx to pass the encrypted traffic to the node.js server.

stream {
  server {
    listen     443;
    proxy_pass your.node.js:443;
  }
}

Note that you will have no access-log or any other means of access to the data.

Share:
10,631
aleclarson
Author by

aleclarson

Updated on July 05, 2022

Comments

  • aleclarson
    aleclarson almost 2 years

    I want to use Nginx to expose my NodeJS server listening on port 443.

    I don't want to manage the SSL certificate with Nginx. I would rather do that on the NodeJS server using the SNICallback option of https.createServer.

    How do I setup the nginx.conf to support this?