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

    Haproxy error 503 on https

    Scheduled Pinned Locked Moved Cache/Proxy
    3 Posts 2 Posters 8.9k 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
      TheNetStriker
      last edited by

      I'am new to haproxy (I only used squid) and I want to setup a reverse https proxy for my server. I've tried several configurations but nothing worked so far. At the moment my haproxy returns the error "503 Service Unavailable No server is available to handle this request". On the stats page the server seams to be ready. What could cause this error? Here is my current config:

      
      global
      	maxconn			100
      	log			/var/run/log	local0	info
      	stats socket /tmp/haproxy.socket level admin
      	uid			80
      	gid			80
      	nbproc			1
      	chroot			/tmp/haproxy_chroot
      	daemon
      	log-send-hostname		Haproxy
      
      listen HAProxyLocalStats
      	bind 127.0.0.1:2200 name localstats
      	mode http
      	stats enable
      	stats admin if TRUE
      	stats uri /haproxy_stats.php?haproxystats=1
      	timeout client 5000
      	timeout connect 5000
      	timeout server 5000
      
      frontend SERVER01
      	bind			0.0.0.0:5556 name 0.0.0.0:5556 ssl  crt /var/etc/haproxy/SERVER01.pem  
      	mode			http
      	log			global
      	option			httplog
      	option			http-keep-alive
      	maxconn			100
      	timeout client		30000
      	acl			aclusr_path_starts_with_https:_2f_2fwww.myurl.com:5556_2fMySite	path_beg -i https://www.myurl.com:5556_2fMySite
      	use_backend		SERVER01_HTTPS_http_ipvANY if aclusr_path_starts_with_https:_2f_2fwww.myurl.com:5556_2fMySite
      
      backend SERVER01_HTTPS_http_ipvANY
      	mode			http
      	balance			roundrobin
      	timeout connect		30000
      	timeout server		30000
      	retries			3
      	option			httpchk GET / 
      	server			SERVER01_HTTPS 172.17.2.23:443 ssl check inter 60000  weight 1 verify none 
      
      
      1 Reply Last reply Reply Quote 0
      • P
        PiBa
        last edited by

        The acl likely does not match the 'path' haproxy finds in the client request. Try configuring it as 'defaultbackend', or just without a acl.

        http://cbonte.github.io/haproxy-dconv/snapshot/configuration-1.6.html#path

        Only the part between / and ? is used.

        1 Reply Last reply Reply Quote 0
        • T
          TheNetStriker
          last edited by

          It seams that haproxy does not include the hostname in the path. I've changed my hcl like this:

          path starts with /MySite
          host equals www.mysite.com

          This works perfectly. Thanks for your help.

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