Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Ha proxy and home assistant

    Scheduled Pinned Locked Moved Cache/Proxy
    1 Posts 1 Posters 370 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • T
      t.moro
      last edited by

      I've a problem conntecting from outside to home assistant behind ha proxy.
      If I set a direct nat roule to port 8123 all works good, but if I try to use the haproxy link to the backend I receive a 503 error page.
      This is my ha config, any idea?
      p.s. all other backends are working correctly

      # Automaticaly generated, dont edit manually.
      # Generated on: 2023-07-31 19:46
      global
      	maxconn			1000
      	stats socket /tmp/haproxy.socket level admin  expose-fd listeners
      	uid			80
      	gid			80
      	nbproc			1
      	nbthread			1
      	hard-stop-after		15m
      	chroot				/tmp/haproxy_chroot
      	daemon
      	tune.ssl.default-dh-param	2048
      	server-state-file /tmp/haproxy_server_state
      
      frontend http
      	bind			192.168.1.220:80 name 192.168.1.220: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 
      
      frontend https_443
      	bind			192.168.1.220:443 name 192.168.1.220:443   ssl crt-list /var/etc/haproxy/https_443.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			ha	var(txn.txnhost) -m beg -i ha.mysite.org
      	acl			NAS	var(txn.txnhost) -m beg -I nas.mysite.org
      	acl			www	var(txn.txnhost) -m beg -I www.mysite.org
      	acl			proxmox	var(txn.txnhost) -m beg -I proxmox.mysite.org
      	acl			firewall	var(txn.txnhost) -m beg -I firewall.mysite.org
      	http-request set-var(txn.txnhost) hdr(host)
      	use_backend ha_ipvANY  if  ha 
      	use_backend NAS_ipvANY  if  NAS 
      	use_backend serverweb_ipvANY  if  www 
      	use_backend proxmox_ipvANY  if  proxmox 
      	use_backend firewall_ipvANY  if  firewall 
      
      backend ha_ipvANY
      	mode			http
      	id			102
      	log			global
      	timeout connect		30000
      	timeout server		30000
      	retries			3
      	timeout tunnel 60000s
      	server			ha 192.168.1.138:8123 id 103 ssl  verify none 
      
      backend NAS_ipvANY
      	mode			http
      	id			100
      	log			global
      	timeout connect		30000
      	timeout server		30000
      	retries			3
      	server			nas8 192.168.1.112:8080 id 101  
      
      backend serverweb_ipvANY
      	mode			http
      	id			104
      	log			global
      	timeout connect		30000
      	timeout server		30000
      	retries			3
      	server			www 192.168.1.239:80 id 105  
      
      backend proxmox_ipvANY
      	mode			http
      	id			106
      	log			global
      	timeout connect		30000
      	timeout server		30000
      	retries			3
      	server			proxmox 192.168.1.236:8006 id 107 ssl  verify none 
      
      backend firewall_ipvANY
      	mode			http
      	id			108
      	log			global
      	timeout connect		30000
      	timeout server		30000
      	retries			3
      	server			firewall 192.168.1.1:80 id 105
      

      Thanks

      1 Reply Last reply Reply Quote 0
      • First post
        Last post
      Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.