因此,我在Jetty前面使用HAProxy。目前的目标只是证明概念,负载和压力测试,一旦一切都配置好。不过,我在配置have时遇到了问题。我知道我的应用程序没有问题,因为我正在运行nginx(tengine),而且一切都正常工作。因此,它必须是具有has配置的东西,或者仅仅是has工作方式不适合我的需要。
因此,我的客户端要做的是使用两个不同的连接连接到what,并将它们保持打开:
下面是我的haproxy.conf文件的样子:
global
log /dev/log local0
log /dev/log local1 notice
chroot /var/lib/haproxy
stats socket /run/haproxy/admin.sock mode 660 level admin
stats timeout 30s
user haproxy
group haproxy
daemon
# Default SSL material locations
# ca-base /etc/ssl/certs
# crt-base /etc/ssl/private
# Default ciphers to use on SSL-enabled listening sockets.
# For more information, see ciphers(1SSL).
ssl-default-bind-ciphers kEECDH+aRSA+AES:kRSA+AES:+AES256:RC4-SHA:!kEDH:!LOW:!EXP:!MD5:!aNULL:!eNULL
maxconn 2048
defaults
log global
mode http
option forwardfor
option http-server-close
option httplog
option dontlognull
timeout connect 5000
timeout client 50000
timeout server 50000
errorfile 400 /etc/haproxy/errors/400.http
errorfile 403 /etc/haproxy/errors/403.http
errorfile 408 /etc/haproxy/errors/408.http
errorfile 500 /etc/haproxy/errors/500.http
errorfile 502 /etc/haproxy/errors/502.http
errorfile 503 /etc/haproxy/errors/503.http
errorfile 504 /etc/haproxy/errors/504.http
stats enable
stats uri /stats
stats realm Haproxy\ Statistics
stats auth user:password
frontend www-http
bind *:80
reqadd X-Forwarded-Proto:\ http
default_backend www-backend
frontend www-https
bind *:443 ssl crt /etc/haproxy/server.pem
reqadd X-Forwarded-Proto:\ https
default_backend www-backend
backend www-backend
redirect scheme https if !{ ssl_fc }
server www-1 localhost:8080 check maxconn 2048当我试图访问端口443时,我的日志是这样写的:
9月17日11:10:18 xxxxx-pc haproxy15993: 127.0.0.1:32875 17 /9/2014:11:10:18.464 www- https~ www-后端/www-1/ 0/0 /-1/1 502 212 -PH-0/0/0/0/0/ 0/0/0/0/0 /0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/
有什么问题吗?配置有问题吗?
谢谢。
发布于 2014-09-28 17:24:14
PH意味着that拒绝了来自后端的标题,因为它的格式不正确。http://www.haproxy.org/download/1.4/doc/configuration.txt
PH -代理阻止服务器的响应,因为它是无效的、不完整的、危险的(缓存控制)或匹配一个安全过滤器。在任何情况下,HTTP 502错误被发送到客户端。造成此错误的一个可能原因是HTTP标头名称中包含未经授权字符的无效语法。在服务器响应之前,代理也可能但非常罕见地阻止了来自客户端的分组编码请求,这是因为一个无效的语法。在这种情况下,会向客户端发送HTTP 400错误,并在日志中报告。
https://stackoverflow.com/questions/25886806
复制相似问题