1

I have configured HAProxy as reverse proxy - with single SharePoint site, server and it's working (SSL pass-through on IIS), but when I'm trying to configure two compeletly different SharePoint sites with different servers on the same HAProxy config, it doesn't work. I have configured two network adapters on Linux - local network and public network. On Windows I have only local network - Windows is connecting with Linux in local network and then through HAProxy I can open the SharePoint site from the internet. I was trying in a few ways to do it for multiple sites without result.

Additional info: system Linux Debian 9.5 Stretch; HAProxy 1.7.5-2


First haproxy.cfg

If I will comment out the 'second' site - then the 'first' will work and If I will comment out the 'first' - then the 'second' will work. So both sites are working separately.

global
    maxconn 4096
    spread-checks 2
    user haproxy
    group haproxy
    daemon
defaults
    mode tcp
    log 127.0.0.1 local0 notice
    maxconn 2000
    option tcplog
    option dontlognull
    timeout connect 20s
    timeout client 10m
    timeout server 10m

frontend firstfront
    mode tcp
    bind *:443
    acl hosts_firstback hdr_end(host) -i first.sharepoint-a.com
    use_backend firstback if hosts_firstback
    default_backend firstback
backend firstback
    mode tcp
    balance roundrobin
    option redispatch
    server FIRSTSERVER 111.111.111.111:443
    option ssl-hello-chk

frontend secondfront 
    mode tcp
    bind *:443
    acl hosts_secondback hdr_end(host) -i second.sharepoint-b.com
    use_backend secondback if hosts_secondback
    default_backend secondback
backend secondback
    mode tcp
    balance roundrobin
    option redispatch
    server SECONDSERVER 222.222.222.222:443
    option ssl-hello-chk

Above haproxy.cfg:

first.sharepoint-a.com - Not Found. HTTP Error 404.

second.sharepoint-b.com - Connection failed.

$ sudo systemctl status haproxy without errors.

$ sudo haproxy -c -f haproxy.cfg
Configuration file is valid

haproxy.log without errors

Second haproxy.cfg

global
    maxconn 4096
    spread-checks 2
    user haproxy
    group haproxy
    daemon
defaults
    mode tcp
    #option forwardfor
    log 127.0.0.1 local0 notice
    maxconn 2000
    option tcplog
    option dontlognull
    timeout connect 20s
    timeout client 10m
    timeout server 10m

frontend spfront
    mode tcp
    bind *:443
    use_backend firstback if { hdr(host) -i first.sharepoint-a.com }
    use_backend secondback if { hdr(host) -i second.sharepoint-b.com }

backend firstback
    mode tcp
    server FIRSTSERVER 111.111.111.111:443

backend secondback
    mode tcp
    server SECONDSERVER 222.222.222.222:443

first.sharepoint-a.com - Secure connection failed.

second.sharepoint-b.com - Connection failed.

$ sudo systemctl status haproxy without errors.

$ sudo haproxy -c -f haproxy.cfg
Configuration file is valid

haproxy.log without errors


I tried with many combinations and result is the same or similar. Please help me with the configuration file - where I made a mistakes and feel free to ask.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.