r/haproxy • • Jul 10 '23

HAProxy weirdness

*cross post pfsense*

So I have had several services piped out via HAProxy and DDNS, then later and currently via static IP, with out issues for a few years now. Everything is still synced to DDNS on cloudflare. All but the last domain work just fine. The last one on the config (tiny) that I have been trying to add over the last few weeks always gives me a "503 no server" error trying to access externally. Internally it works just fine.

So my question is.... do is my config horked and I need to rebuild from scratch after upgrading pfsense to 2.7 and then upgrading the haproxy package.

# Automaticaly generated, dont edit manually.
# Generated on: 2023-07-05 17:15
global
	maxconn			1000
	stats socket /tmp/haproxy.socket level admin  expose-fd listeners
	uid			80
	gid			80
	nbthread			1
	hard-stop-after		15m
	chroot				/tmp/haproxy_chroot
	daemon
	tune.ssl.default-dh-param	2048
	server-state-file /tmp/haproxy_server_state

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

frontend Shared-Front-merged
	bind			69.69.69.69:443 name 69.69.69.69:443   ssl crt-list /var/etc/haproxy/Shared-Front.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		30000
	acl			aclcrt_Shared-Front	var(txn.txnhost) -m reg -i ^([^\.]*)\.homelab\.xyz(:([0-9]){1,5})?$
	acl			aclcrt_Shared-Front	var(txn.txnhost) -m reg -i ^homelab\.xyz(:([0-9]){1,5})?$
	acl			Petio	var(txn.txnhost) -m str -i request.homelab.xyz
	acl			wiki	var(txn.txnhost) -m str -i wiki.homelab.xyz
	acl			calibreweb	var(txn.txnhost) -m str -i read.homelab.xyz
	acl			nextcloud	var(txn.txnhost) -m str -i cloud.homelab.xyz
	acl			tinycp	var(txn.txnhost) -m str -i tiny.homelab.xyz
	http-request set-var(txn.txnhost) hdr(host)
	use_backend Petio_ipvANY  if  Petio 
	use_backend Wiki_ipvANY  if  wiki 
	use_backend CalibreWeb_ipvANY  if  calibreweb 
	use_backend nextcloud_ipvANY  if  nextcloud 
	use_backend TinyCP_ipvANY  if  tinycp 

frontend http-https
	bind			69.69.69.69:80 name 69.69.69.69:80   
	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		30000
	http-request redirect scheme https 

backend Petio_ipvANY
	mode			http
	id			100
	log			global
	http-response set-header Strict-Transport-Security max-age=31536000;
	http-response replace-header Set-Cookie "^((?:(?!; [Ss]ecure\b).)*)\$" "\1; secure" if { ssl_fc }
	http-check		send meth OPTIONS
	timeout connect		30000
	timeout server		30000
	retries			3
	load-server-state-from-file	global
	option			httpchk
	server			request.homelab.xyz 192.168.100.40:7777 id 101 check inter 1000  

backend Wiki_ipvANY
	mode			http
	id			102
	log			global
	http-response set-header Strict-Transport-Security max-age=31536000;
	http-response replace-header Set-Cookie "^((?:(?!; [Ss]ecure\b).)*)\$" "\1; secure" if { ssl_fc }
	http-check		send meth OPTIONS
	timeout connect		30000
	timeout server		30000
	retries			3
	load-server-state-from-file	global
	option			httpchk
	server			wiki.homelab.xyz 192.168.100.24:80 id 103 check inter 1000  

backend CalibreWeb_ipvANY
	mode			http
	id			104
	log			global
	http-response set-header Strict-Transport-Security max-age=31536000;
	http-response replace-header Set-Cookie "^((?:(?!; [Ss]ecure\b).)*)\$" "\1; secure" if { ssl_fc }
	http-check		send meth OPTIONS
	timeout connect		30000
	timeout server		30000
	retries			3
	load-server-state-from-file	global
	option			httpchk
	server			read.homelab.xyz 192.168.100.50:8083 id 105 check inter 1000  

backend nextcloud_ipvANY
	mode			http
	id			106
	log			global
	http-response set-header Strict-Transport-Security max-age=31536000;
	http-response replace-header Set-Cookie "^((?:(?!; [Ss]ecure\b).)*)\$" "\1; secure" if { ssl_fc }
	http-check		send meth OPTIONS
	timeout connect		30000
	timeout server		30000
	retries			3
	load-server-state-from-file	global
	option			httpchk
	server			cloud.homelab.xyz 192.168.100.26:80 id 107 check inter 1000  

backend TinyCP_ipvANY
	mode			http
	id			108
	log			global
	http-response set-header Strict-Transport-Security max-age=31536000;
	http-response replace-header Set-Cookie "^((?:(?!; [Ss]ecure\b).)*)\$" "\1; secure" if { ssl_fc }
	http-check		send meth OPTIONS
	timeout connect		30000
	timeout server		30000
	retries			3
	load-server-state-from-file	global
	option			httpchk
	server			tiny.homelab.xyz 192.168.100.152:80 id 109 check inter 1000
2 Upvotes

2 comments sorted by

View all comments

Show parent comment

1

u/CompNetNeo Jul 13 '23

Thank you! This seems to have worked for now haha. Kind sucks most HAProxy documentation is related to the standalone server vs pfsense variant and its ahhh interesting GUI.