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
# option httplog
option tcplog
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
#для 80 порта
frontend http_frontend
mode http
option httplog
bind 192.168.1.7:80
option forwardfor
acl host_1Cwww hdr(host) -i het099wry1y.sn.mynetname.net
acl host_wiki hdr(host) -i onedayadmin.sytes.net
use_backend http_1Cwww if host_1Cwww
use_backend http_wiki if host_wiki
backend http_1Cwww
mode http
# option httplog
option forwardfor
server www 192.168.7.2:80
backend http_wiki
mode http
# option httplog
option forwardfor
server wiki 192.168.1.7:8080
#для 443 порта
frontend https
bind 192.168.1.7:443 #ip servera
mode tcp
tcp-request inspect-delay 5s
tcp-request content accept if { req_ssl_hello_type 1 }
use_backend ocserv if { req_ssl_sni -i bo.beerhoff.beer }
use_backend nginx if { req_ssl_sni -i www.onedayadmin.sytes.net }
use_backend nginx if { req_ssl_sni -i onedayadmin.sytes.net }
use_backend cloud if { req_ssl_sni -i cloud.beerhoff.beer }
use_backend onlyoffice if { req_ssl_sni -i onlyoffice.beerhoff.beer }
use_backend matrix if { req_ssl_sni -i matrix.beerhoff.beer }
# use_backend guard if { req_ssl_sni -i guard.beerhoff.beer }
use_backend mobile1C if { req_ssl_sni -i het099wry1y.sn.mynetname.net }
default_backend ocserv
backend ocserv
mode tcp
option ssl-hello-chk
server ocserv 127.0.0.1:444 send-proxy-v2
backend nginx
mode tcp
option ssl-hello-chk
server nginx 127.0.0.1:443 check
backend cloud
mode tcp
option ssl-hello-chk
server cloud 192.168.1.8:443 check
backend onlyoffice
mode tcp
option ssl-hello-chk
server onlyoffice 192.168.1.4:4443 check
backend matrix
mode tcp
option ssl-hello-chk
server matrix 192.168.1.3:443 check
backend mobile1C
mode tcp
option ssl-hello-chk
server mobile1C 192.168.1.2:443 check

