@bastify wrote:
Hi,
With the next conf haproxy not recognize my domains and all HTTPS traffic goes to default backend. Any help is appreciated.
Global settings
#---------------------------------------------------------------------
global
log 127.0.0.1 local2 #Log configurationchroot /var/lib/haproxy pidfile /var/run/haproxy.pid maxconn 4000 user haproxy #Haproxy running under user and group "haproxy" group haproxy daemon # turn on stats unix socket stats socket /var/lib/haproxy/stats#---------------------------------------------------------------------
defaults
#---------------------------------------------------------------------
defaults
mode http
log global
option tcplog
option dontlognull
option http-server-close
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 Configuration
#---------------------------------------------------------------------
frontend main-http
bind *:80
reqadd X-Forwarded-Proto:\ http
#acl host_dirbit hdr(host) -i directoriobitcoin.com
use_backend app-main if { hdr_dom(host) -i directoriobitcoin.com }
use_backend app-main-bm if { hdr_dom(host) -i bemadrid.com }
use_backend app-main-mh if { hdr_dom(host) -i madridhappypeople.com }
default_backend app-mainfrontend main-https
bind *:443
reqadd X-Forwarded-Proto:\ https
mode tcp
use_backend app-main-https if { hdr_dom(Host) -i directoriobitcoin.com }
use_backend app-main-bm-https if { hdr_dom(Host) -i bemadrid.com }
use_backend app-main-mh-https if { hdr_dom(Host) -i madridhappypeople.com }
default_backend app-main-https#---------------------------------------------------------------------
BackEnd roundrobin as balance algorithm
#---------------------------------------------------------------------
backend app-main
balance roundrobin
server cpanel1 31.200.246.100:80 check
server cpanel2 92.222.66.209:80 checkbackend app-main-https
balance roundrobin
mode tcp
server cpanel1 31.200.246.100:443 check
server cpanel2 92.222.66.209:443 checkbackend app-main-bm
balance roundrobin
server cpanel1 31.200.246.100:80 check
server cpanel2 92.222.66.209:80 checkbackend app-main-bm-https
balance roundrobin
mode tcp
server cpanel1 31.200.246.100:443 check
server cpanel2 92.222.66.209:443 checkbackend app-main-mh
balance roundrobin
server cpanel1 31.200.246.100:80 check
server cpanel2 92.222.66.209:80 checkbackend app-main-mh-https
balance roundrobin
mode tcp
server cpanel1 31.200.246.100:443 check
server cpanel2 92.222.66.209:443 check
Posts: 1
Participants: 1