【发布时间】:2013-04-06 04:44:51
【问题描述】:
我目前正在参与以负载均衡器为后端的清漆实现,该后端应将流量相应地转发到多个 Web 服务器。
我正在努力实现:
Public Traffic -> haproxy/DNS -> [Varnish (x2) / nginx(ssl) ] -> Loadbalancer -> Web server(x4)
我可以将 Varnish 、 nginx 配置为一个域的 ssl/443 终结器。 (即,如果我将 dns 指向 varnish eth 并访问网络服务器为页面提供服务)
清漆配置
backend loadbalancer { .host = "xxx.xxx.xxx.xxx"; .port = "80" }
backend loadbalancer_ssl { .host = "xxx.xxx.xxx.xxx"; .port = "443"; }
sub vcl_recv {
# Set the director to cycle between web servers.
if (server.port == 443) {
set req.backend = loadbalancer_ssl;
}
else {
set req.backend = loadbalancer;
}
}
# And other vcl rules for security and other.
Nginx 配置
location / {
# Pass the request on to Varnish.
proxy_pass http://127.0.0.1;
proxy_http_version 1.1;
#SSL certificate and config
=> 我将如何实现将清漆配置为具有多个域的 ssl 终止的 dns 入口点? => 是否有可能以某种方式配置清漆以接受所有连接并直接绕过 ssl 到 Web 服务器? (这样我就不必担心支持 ssl 的多个接口)
=> 或者任何使用 443 终结器实现的标准方法?
注意:我为什么要这样做:创建多层安全性并使用现有硬件设备。
已经到位:
- 所有服务器都有(使用 lightty 的 ssl 的多个接口)。
- 负载平衡器 -> 硬件 -> 将平衡这些 Web 服务器之间的负载。
任何分享那里观点的专家都会很棒。
【问题讨论】:
-
这也可以通过其他方式解决:通过将 ssl 流量传递到后端而不解释或终止它。然而,清漆是否有能力将来自 443 端口的流量发送到负载均衡器? [我不确定 varnish 将如何处理/处理 ssl 流量,如果有人有通过 ssl 流量进入 varnish 的经验,这将是很大的帮助。当然,又是多个域。]