[英]HAproxy and Node.js+Spdy
我目前正在使用node spdy来提供文件。 这很漂亮。
但是,我想使用HAproxy在这些节点服务器之间进行负载平衡。 但是,当我的节点/间谍服务器位于HAproxy后面时, request.isSpdy
为false
…突然不支持spdy吗?
这是我的HAproxy配置:全局maxconn 4096
defaults
timeout connect 5000ms
timeout client 50000ms
timeout server 50000ms
frontend http_proxy
mode http
bind *:80
redirect prefix https://awesome.com code 301
frontend https_proxy
mode tcp
bind *:443
default_backend webservers
backend webservers
balance source
server server1 127.0.0.1:10443 maxconn 4096
# server server2 127.0.0.1:10444 maxconn 4096
谢谢!
您不能在SPDY中使用HAProxy的HTTP负载平衡机制。 首先,您需要使用最新的开发分支来启用对NPN(因此也支持SPDY)的支持,然后,您必须对其进行配置以使其更接近简单的TCP负载平衡模式运行-HAProxy无法理解SPDY。
有关HAProxy + SPDY配置脚本的示例,请参见此处: http : //www.igvita.com/2012/10/31/simple-spdy-and-npn-negotiation-with-haproxy/
我遇到了同样的问题。 我不再使用spdy,而是回到使用express并使haproxy使用http / 2协议。
frontend http-in
bind *:80
mode http
redirect scheme https code 301
frontend https-in
mode http
bind *:443 ssl crt /path/to/cert.pem alpn h2,http/1.1
这里的关键是这部分alpn h2,http/1.1
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.