nginx:将 ssl 连接转发到另一台服务器 [英] nginx: forward ssl connection to another server

查看:331
本文介绍了nginx:将 ssl 连接转发到另一台服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个主 nginx 服务器,它决定将请求路由到的传入服务器名称.对于两个辅助服务器,这个主 nginx 服务器也持有 ssl 证书和密钥.第 3 个服务器持有他自己的证书和密钥,因为它们有一个频繁的更新过程.

I have a master nginx server deciding on the incoming server name where to route requests to. For two secondary servers this master nginx server is also holding ssl certificates and keys. The 3rd server is holding his own certificates and keys because there is a frequent update process for those.

我现在的问题是如何配置主 nginx 服务器以将所有请求转发到服务器 3,这些请求正在进入该服务器.我无法将证书和密钥从服务器 3 复制到主服务器,因为它们经常更改.

My question is now how I can configure the master nginx server to forward all requests to server 3 which are coming in for this server. I cannot copy the certificates and keys from server 3 to the master server as they change too often.

推荐答案

尝试代理 tcp 流量而不是 http 流量

Try to proxy the tcp traffic instead of the http traffic

stream {
    server {
        listen SRC_IP:SRC_PORT;
        proxy_pass DST_IP:DST_PORT;
   }
}

更多细节参考nginx文档https://docs.nginx.com/nginx/admin-guide/load-balancer/tcp-udp-load-balancer/

for more details refer to the nginx documentation https://docs.nginx.com/nginx/admin-guide/load-balancer/tcp-udp-load-balancer/

这篇关于nginx:将 ssl 连接转发到另一台服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆