【发布时间】:2016-11-12 16:24:53
【问题描述】:
我使用 HAProxy 作为负载平衡器并终止 SSL。在这之后,我放置了一个 Nginx。我想使用 spdy/3.1。
它不适用于以下 haproxy.conf 和 nginx.cfg。 (文件是服务器,但根据Chrome SPDY/HTTP2 Indicator Plugin 这只是正常的 HTTP/1.1 流量)。
我试图去掉不必要的部分。
我做错了什么?你有调试技巧吗?
(HAProxy 1.6 当前和 NginX 1.10 稳定线)
haproxy.cfg:
global
daemon
tune.ssl.default-dh-param 2048
defaults
mode tcp
frontend myfrontend
bind *:80
bind *:443 ssl crt /etc/ssl/certificate.pem npn spdy/3.1,http/1.1 ciphers ECDH+AESGCM:HIGH:!aNULL:!MD5:!DSS:!RC4; no-sslv3
acl istoplevel path /
redirect scheme https if istoplevel !{ ssl_fc }
redirect location / if !istoplevel !{ ssl_fc }
rspadd Strict-Transport-Security:\ max-age=31536000;
default_backend mybackend
backend mybackend
server s1 localhost:81
option forwardfor
http-request set-header X-Forwarded-Port %[dst_port]
http-request add-header X-Forwarded-Proto https if { ssl_fc }
nginx.conf:
user nginx;
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
sendfile on;
#tcp_nopush on;
server {
listen 81 spdy;
root /usr/share/nginx/html;
index index.html;
location / {
try_files $uri $uri/ /index.html;
}
}
}
【问题讨论】:
-
Nginx 是使用 --with-http_v2-module 构建的。这包括spdy吗?文档对此并不那么冗长
标签: nginx haproxy http2 spdy multiplexing