HAProxy community

HAProxy 1 IP for multiple website on diffrent domain


#1

I am trying to host 2 Wordpress multisite on 2 Domain with HAProxy But i get NOSRV error. I got it working with subdomain but never diffrent domain

Time: Feb 5 20:16:53
IP: 192.168.0.1
Host:
Facility: local0
Priority: err
Tag: haproxy[3970]
Message: 192.168.0.100:54436 [05/Feb/2019:20:16:53.453] MainWebsite~ MainWebsite/ -1/-1/-1/-1/2 400 187 - - CR-- 4/4/0/0/0 0/0 “”
This is my configuration
global
maxconn 10000
log 192.168.0.100 local0 debug
stats socket /tmp/haproxy.socket level admin
gid 80
nbproc 1
hard-stop-after 15m
chroot /tmp/haproxy_chroot
daemon
tune.ssl.default-dh-param 4096
server-state-file /tmp/haproxy_server_state

listen HAProxyLocalStats
	bind 127.0.0.1:2200 name localstats
	mode http
	stats enable
	stats admin if TRUE
	stats show-legends
	stats uri /haproxy/haproxy_stats.php?haproxystats=1
	timeout client 5000
	timeout connect 5000
	timeout server 5000

resolvers globalresolvers
	nameserver cloudflare 1.1.1.1:853
	resolve_retries 3
	timeout retry 1s
	hold valid 10s
frontend custu
	bind			0.0.0.0:44310 name 0.0.0.0:44310   ssl crt-list /var/etc/haproxy/custu.crt_list  
	mode			http
	log			global
	option			http-keep-alive
	option			forwardfor
	acl https ssl_fc
	http-request set-header		X-Forwarded-Proto http if !https
	http-request set-header		X-Forwarded-Proto https if https
	timeout client		3600000
	errorfile			503 /var/etc/haproxy/errorfile_custu_503_error503
	errorfile			504 /var/etc/haproxy/errorfile_custu_504_error504
	acl			cudstudent	var(txn.txnhost) -m end -i cudstudent.com
	acl			siwatinc	var(txn.txnhost) -m end -i siwatinc.com
	acl			aclcrt_custu	var(txn.txnhost) -m reg -i ^siwatinc\.com(:([0-9]){1,5})?$
	acl			aclcrt_custu	var(txn.txnhost) -m reg -i ^([^\.]*)\.siwatinc\.com(:([0-9]){1,5})?$
	http-request set-var(txn.txnhost) hdr(host)
	use_backend mainsite_ipvANY  if  siwatinc aclcrt_custu
	use_backend satitm-node_ipvANY  if  cudstudent aclcrt_custu
	use_backend satitm-node_ipvANY  if   aclcrt_custu
backend mainsite_ipvANY
	mode			http
	id			121
	log			global
	timeout connect		30000
	timeout server		30000
	retries			3
	server			135 192.168.0.97:443 id 122 ssl check inter 1000  verify none resolvers globalresolvers 
backend satitm-node_ipvANY
	mode			http
	id			182
	log			global
	balance			roundrobin
	timeout connect		30000
	timeout server		30000
	retries			3
	server			satitm 192.168.0.97:4430 id 183 ssl check inter 1000  verify none resolvers globalresolvers

#2

Please share that log then. You shared the log of a different, unrelated issue.

Which domain works on which one does not work EXACTLY ?


#3

I got it working now, I just add the ACL in the backend instead of the frontend


#4

I got same issue can you share your configuration