HAProxy sub-directory routing.
-
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"