首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >我如何配置haproxy将两个前端放在网上访问owa?

我如何配置haproxy将两个前端放在网上访问owa?
EN

Server Fault用户
提问于 2018-10-20 11:47:08
回答 2查看 5.1K关注 0票数 0

当我重定向到在互联网上显示OWA时,我在Ubuntu16.04服务器上面临一个HAPROXY问题。我有一个域,我在windows 2012 r2上安装了exchange服务器2013年。我需要在443和80个端口上为OWA使用第二个使用tcp的前端。

问题是,OWA有时会出现,在刷新页面后,会出现错误或使用不同CA的另一个站点,这是因为旧的前端http in(模式http)。我有LetsEncrypt为我所有的站点分配到端口443。

请,我需要一个解决方案,打开OWA和其他网站。

这是我来自第一个前端的haproxy配置文件:

代码语言:javascript
复制
frontend haproxy_in
bind *:80
bind *:443 ssl crt /etc/haproxy/certs/mdl.ief.tishreen.edu.sy.pem crt /etc/haproxy/certs/mail.ief.tishreen.edu.sy.pem  crt /etc/haproxy/certs/lib.ief.tishreen.edu.sy.pem crt /etc/haproxy/certs/ief.tishreen.edu.sy.pem crt /etc/haproxy/certs/www.ief.tishreen.edu.sy.pem crt /etc/haproxy/certs/educloud.ief.tishreen.edu.sy.pem crt /etc/haproxy/certs/vpn.ief.tishreen.edu.sy.pem
mode http
# Define Path For LetsEncrypt.........................
acl is_letsencrypt path_beg -i /.well-known/acme-challenge/
use_backend letsencrypt if is_letsencrypt
# Define hosts........................................
acl is_moodle hdr_dom(host) -i mdl.ief.tishreen.edu.sy
acl is_lib hdr_dom(host) -i lib.ief.tishreen.edu.sy
acl is_mail hdr_dom(host) -i mail.ief.tishreen.edu.sy
acl is_vpn hdr_dom(host) -i vpn.ief.tishreen.edu.sy
acl is_www hdr_dom(host) -i www.ief.tishreen.edu.sy
# Direct hosts to backend..............................
use_backend moodle if is_moodle
use_backend lib if is_lib
use_backend vpn if is_vpn
use_backend www if is_www
default_backend base
# Redirect port 80 t0 443 except lets encrypt............
redirect scheme https code 301 if !{ ssl_fc } !is_letsencrypt
### exchange owa frontend####
frontend exchange-server
bind *:80
bind *:443
mode tcp
acl is_mail hdr_dom(host) -i mail.ief.tishreen.edu.sy
use_backend mail if is_mail

default_backend base

backend mail
balance roundrobin
mode tcp
server vm3 172.17.16.22:443 check
######################
#            #
#   Backends     #
#            #
######################
backend letsencrypt
server letsencrypt 127.0.0.1:8888
backend moodle
balance roundrobin
mode http
server vm1 172.17.16.20:80 check

backend lib
balance roundrobin
mode http
server vm2 172.17.16.18:80/akasia check


backend vpn
balance roundrobin
mode http
server vm4 172.17.16.35:1194 check

backend www
balance roundrobin
mode http
server vm5 172.17.16.25:80 check

backend base
balance roundrobin
mode http
server vmtest 172.17.16.25:80 check


###############################
EN

回答 2

Server Fault用户

发布于 2018-10-21 14:43:07

使用tcp作为https连接的后端模式时,HAproxy本身就像SSL一样无法工作。

有两种方法可以使您的配置基于您的设置工作:

1:编辑您的OWA配置以允许http连接,然后使用http作为后端模式,只将SSL作业留给HAProxy。

2:编辑您的HAProxy配置,使其在后端使用https而不使用ssl验证,如下所示:

代码语言:javascript
复制
backend mail
    balance roundrobin
    mode http
    server vm3 172.17.16.22:443 ssl verify none
票数 0
EN

Server Fault用户

发布于 2019-01-15 15:15:01

尝试这个配置,只使用一个前端(我使用一个公共IP和两个内部服务器( SSL) ),这两个服务器都可以在端口443和80上实现(更新letsencrypt证书需要80)。服务器处于不同的子网中,没有问题。我在have站点上没有任何证书,在内部和公共dns中也没有相同的名称。

代码语言:javascript
复制
frontend ft_ssl_vip
  mode tcp
  bind *:443
  bind *:80
  tcp-request inspect-delay 5s
  acl sslv3 req.ssl_ver 3
  tcp-request content reject if sslv3
  tcp-request content accept if { req_ssl_hello_type 1 }
  default_backend bk_ssl_default

backend bk_ssl_default
  mode tcp
# Using SNI to take routing decision
  acl exchange1 req_ssl_sni -i email.tld.com
  acl exchange2 req_ssl_sni -i autodiscover.tld.com
  acl nextcloud1 req_ssl_sni -i cloud.tld.com
  use-server server1 if exchange1
  use-server server1 if exchange2
  use-server server2 if nextcloud1

  stick-table type binary len 32 size 30k expire 30m

  acl clienthello req_ssl_hello_type 1
  acl serverhello rep_ssl_hello_type 2

# use tcp content accepts to detects ssl client and server hello.
  tcp-request inspect-delay 5s
  tcp-request content accept if clienthello

# no timeout on response inspect delay by default.
  tcp-response content accept if serverhello

  stick on payload_lv(43,1) if clienthello

# Learn on response if server hello.
  stick store-response payload_lv(43,1) if serverhello

  option ssl-hello-chk
  server server1 192.168.xx1.xx1 check
  server server2 192.168.xx2.xx2 check 
票数 0
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/936432

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档