Nginx 负载均衡器 SSL 证书
Nginx load balancer SSL certs
我是 NGINX 的新手。
我想使用免费版(不是nginx plus)在3台服务器之间进行负载平衡(反向代理),连接必须是SSL/443。
我是将 SSL 证书放在 NGINX 负载平衡器服务器上,还是将 3 个 SSL 证书分别放在 3 个 Web 服务器上?我听到褒贬不一的评论。我正在寻找最佳性能。
附加信息:我使用的是通配符 SSL 证书,其他网络服务器是 IIS,IP_Hash 以在同一网络服务器上保持会话。
再次打开您的配置文件进行编辑。
sudo nano /etc/nginx/conf.d/load-balancer.conf
然后将以下服务器段添加到文件末尾。
server {
listen 443 ssl;
server_name domain_name;
ssl_certificate /etc/letsencrypt/live/domain_name/cert.pem;
ssl_certificate_key /etc/letsencrypt/live/domain_name/privkey.pem;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
location / {
proxy_pass http://backend;
}
}
然后保存文件,退出编辑器,重新启动nginx。
sudo systemctl restart nginx
启用 HTTPS 后,您还可以选择对负载均衡器的所有连接强制加密
server {
listen 80;
server_name domain_name;
return 301 https://$server_name$request_uri;
#location / {
# proxy_pass http://backend;
#}
}
修改后再次保存文件。然后重启nginx。
sudo systemctl restart nginx
这个问题已经在 StackExchange 网络中被问到,但无论如何我都会尝试回答你的问题。
性能影响应该很明显,但这实际上取决于您的情况 运行。
要考虑使用多个证书的一件事是,一旦请求到达负载均衡器,它就会在 datacenter/network.
中保持安全
这在您不拥有硬件且无法物理访问 machines/datacenter 的情况下很有用。这是因为共享 space 中可能有多个人 运行 服务器和应用程序,您无法确定该网络中是否有人在四处窥探和监视流量。你只是不能确定那不会发生。
仅使用一个证书(用于负载均衡器)称为 'SSL Offloading',您可以并且应该在此处找到更多相关信息:
- https://security.stackexchange.com/questions/30403/should-ssl-be-terminated-at-a-load-balancer
- https://security.stackexchange.com/questions/79672/in-detail-how-does-ssl-offloading-acceleration-termination-work
- SSL performance implications
- https://serverfault.com/questions/112547/does-using-ssl-cause-a-significant-performance-hit
我是 NGINX 的新手。
我想使用免费版(不是nginx plus)在3台服务器之间进行负载平衡(反向代理),连接必须是SSL/443。
我是将 SSL 证书放在 NGINX 负载平衡器服务器上,还是将 3 个 SSL 证书分别放在 3 个 Web 服务器上?我听到褒贬不一的评论。我正在寻找最佳性能。
附加信息:我使用的是通配符 SSL 证书,其他网络服务器是 IIS,IP_Hash 以在同一网络服务器上保持会话。
再次打开您的配置文件进行编辑。
sudo nano /etc/nginx/conf.d/load-balancer.conf
然后将以下服务器段添加到文件末尾。
server {
listen 443 ssl;
server_name domain_name;
ssl_certificate /etc/letsencrypt/live/domain_name/cert.pem;
ssl_certificate_key /etc/letsencrypt/live/domain_name/privkey.pem;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
location / {
proxy_pass http://backend;
}
}
然后保存文件,退出编辑器,重新启动nginx。
sudo systemctl restart nginx
启用 HTTPS 后,您还可以选择对负载均衡器的所有连接强制加密
server {
listen 80;
server_name domain_name;
return 301 https://$server_name$request_uri;
#location / {
# proxy_pass http://backend;
#}
}
修改后再次保存文件。然后重启nginx。
sudo systemctl restart nginx
这个问题已经在 StackExchange 网络中被问到,但无论如何我都会尝试回答你的问题。
性能影响应该很明显,但这实际上取决于您的情况 运行。
要考虑使用多个证书的一件事是,一旦请求到达负载均衡器,它就会在 datacenter/network.
中保持安全这在您不拥有硬件且无法物理访问 machines/datacenter 的情况下很有用。这是因为共享 space 中可能有多个人 运行 服务器和应用程序,您无法确定该网络中是否有人在四处窥探和监视流量。你只是不能确定那不会发生。
仅使用一个证书(用于负载均衡器)称为 'SSL Offloading',您可以并且应该在此处找到更多相关信息:
- https://security.stackexchange.com/questions/30403/should-ssl-be-terminated-at-a-load-balancer
- https://security.stackexchange.com/questions/79672/in-detail-how-does-ssl-offloading-acceleration-termination-work
- SSL performance implications
- https://serverfault.com/questions/112547/does-using-ssl-cause-a-significant-performance-hit