Forward HTTPS traffic thru Nginx without SSL certificate

和自甴很熟 提交于 2019-12-10 22:08:46

问题


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?


回答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.




回答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.



来源:https://stackoverflow.com/questions/46412934/forward-https-traffic-thru-nginx-without-ssl-certificate

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!