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

    HAProxy sub-directory routing.

    Scheduled Pinned Locked Moved Cache/Proxy
    1 Posts 1 Posters 469 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.
    • C
      charlie12345
      last edited by charlie12345

      I want HAProxy to use a backend for mysite.com, and then different backends for mysite.com/ombi etc. With my current rules, I am taken to mysite.com but mysite.com/ombi gives me an nginx 404 error in my browser. If I remove mysite.com from my config then I am directed to mysite.com/ombi when I type mysite.com/ombi in the browser. What have I done wrong? Is my 'host contains' always satisfied so doesn't look further? I tried combining ACL Ombi with ACL Organizr for the Ombi backend but it made no diference. Here is the relevant part of my config:

              acl			Organizr	var(txn.txnhost) -m str -i mysite.com
      	acl			Ombi	var(txn.txnpath) -m sub -i ombi
      	acl			aclcrt_Organizr-Frontend	var(txn.txnhost) -m reg -i ^www\.mysite.com(:([0-9]){1,5})?$
      	acl			aclcrt_Organizr-Frontend	var(txn.txnhost) -m reg -i ^mysite.com(:([0-9]){1,5})?$
      	http-request set-var(txn.txnhost) hdr(host)
      	use_backend Organizr_ipvANY  if  Organizr aclcrt_Organizr-Frontend
      	use_backend Ombi_ipvANY  if  Ombi aclcrt_Organizr-Frontend
      
      ===
      

      I'd be grateful if anyone could either point out my error or share a known working config that I could take a look at, as I'm sure this must be easy but am yet to get it right.

      Edit: Solved, I'll leave this up for anyone in the future.Solution was to have mysite.com using "ACL Organizr !Ombi"

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