0

我已将 HAproxy 版本 1.5.4 设置为 2 个 Exchange 多角色服务器的 NLB。

当用户在浏览器中输入平面主机名“webmail”时,我现在正试图让重定向工作。我希望它重定向到https://webmail.domain.com/owa

这是我现有的 haproxy 配置。

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

defaults
log global
mode    tcp
balance roundrobin
retries 3
option redispatch
maxconn 10000
    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


listen OWA 10.20.100.120:443
option httpchk GET /owa/healthcheck.h
http-check expect status 200
server EX2013A.domain.com 10.20.100.126 check port 80
server EX2013B.domain.com 10.20.100.127 check port 80

listen EAC 10.20.100.131:443
option httpchk /eac/healthcheck.h
server EX2013A.domain.com 10.20.100.126 check port 80
server EX2013B.domain.com 10.20.100.127 check port 80

listen EWS 10.20.100.122:443
option httpchk get /ews/healthcheck.h
server EX2013A.domain.com 10.20.100.126 check port 80
server EX2013B.domain.com 10.20.100.127 check port 80

listen OAB 10.20.100.123:443
option httpchk get /oab/healthcheck.h
server EX2013A.domain.com 10.20.100.126 check port 80
server EX2013B.domain.com 10.20.100.127 check port 80


listen Autodiscover 10.20.100.132:443
option httpchk get /autodiscover/healthcheck.h
server EX2013A.domain.com 10.20.100.126 check port 80
server EX2013B.domain.com 10.20.100.127 check port 80

listen OA 10.20.100.133:443
option httpchk get /rpc/healthcheck.h
server EX2013A.domain.com 10.20.100.126 check port 80
server EX2013B.domain.com 10.20.100.127 check port 80

listen SMTP 10.20.100.120:25
option smtpchk
server EX2013A.domain.com 10.20.100.126 check port 25
server EX2013B.domain.com 10.20.100.127 check port 25


listen stats 0.0.0.0:4000
mode http
balance
timeout client 5000
timeout connect 4000
timeout server 30000
stats enable
stats hide-version
stats uri /stats
stats auth admin:password

谢谢

4

1 回答 1

0

您没有准确说明您使用的是哪个版本的 HAProxy,所以我假设这是 1.5。

首先,现在已弃用在部分描述行上创建具有绑定 IP:port 的侦听部分。其次,为了更清楚,我还要在服务器线路上添加端口 443。

请像这样编写您的 OWA 部分:

listen OWA
  bind 10.20.100.120:443
  option httpchk GET /owa/healthcheck.h
  http-check expect status 200
  server EX2013A.domain.com 10.20.100.126:443 check port 80
  server EX2013B.domain.com 10.20.100.127:443 check port 80

现在,要执行重定向,您需要一个专门用于响应 HTTP 清除流量的前端:

frontend OWA_http
  bind 10.20.100.120:80
  http-request redirect location https://%[req.hdr(Host)]/owa/

巴蒂斯特

于 2015-09-14T07:10:31.167 回答