【发布时间】:2018-09-15 10:05:34
【问题描述】:
我在 6 个服务器节点的 Web 应用程序设置中设置了 haproxy。 2 台前端服务器。 2 个网络服务器。 2 个数据库服务器。
我最近为服务器上运行的所有站点添加了 ssl 证书和重定向。我们运行 Drupal 多面设置。所以每个站点在 Web 服务器上都有自己的 apache 配置和 conf 文件。
设置似乎可以工作,但会发生 SSL 重定向在一定时间(通常是 1 几个小时)后失败,我必须不断重新启动 haproxy 才能修复它。我怀疑这是我的 haproxy 的设置问题,或者我正在以错误的方式解决这个问题。
以下是我的 haproxy 配置文件,其中包含帐户和 ip。
谁能给我任何关于我做错了什么的建议?
global
log 127.0.0.1 local2
chroot /var/lib/haproxy
pidfile /var/run/haproxy.pid
maxconn 4000
user haproxy
group haproxy
daemon
stats socket /var/lib/haproxy/stats
defaults
mode tcp
log global
option httplog
option dontlognull
option forwardfor except 127.0.0.0/8
option redispatch
retries 3
timeout http-request 10s
timeout queue 1m
timeout connect 10s
timeout client 1m
timeout server 1m
timeout http-keep-alive 10s
timeout check 10s
maxconn 3000
frontend web-front *:80
acl url_static path_beg -i /static /images /javascript /stylesheets
acl url_static path_end -i .jpg .gif .png .css .js
option abortonclose
option http-keep-alive
default_backend web
frontend web-front-ssl *:443
acl url_static path_beg -i /static /images /javascript /stylesheets
acl url_static path_end -i .jpg .gif .png .css .js
option abortonclose
option http-keep-alive
default_backend web-ssl
listen stats *:9000
maxconn 500
mode http
log global
stats enable
stats refresh 30s
stats hide-version
stats show-node
stats uri /stats
stats auth ******:*******
backend web
balance roundrobin
stick-table type ip size 1m expire 1h
stick on src
server web01 10.10.10.17:80 check maxconn 1000
server web02 10.10.10.18:80 check maxconn 1000
option abortonclose
option http-keep-alive
backend web-ssl
balance roundrobin
stick-table type ip size 1m expire 1h
stick on src
server web01 10.10.10.17:443 check maxconn 1000
server web02 10.10.10.18:443 check maxconn 1000
option abortonclose
option http-keep-alive
【问题讨论】:
标签: apache ssl redirect haproxy