<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Suggestion for Haproxy ACL XOR syntax]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">lately I had to set up multiple a haproxy frontend for one of our WAN IPs which has multiple backends - one for each customer.</p>
<p dir="auto">Some customers require us to access the backend from any WAN IP, some others from specific subnets. Since a Firewall-Rule on the same port (eg. 443) for our WAN IP can either be from any IP source or a specific one, I decided to setup it the following way:</p>
<ul>
<li>
<p dir="auto">Each frontend has multiple acls for each URL and also for each customer subnet, if required.</p>
</li>
<li>
<p dir="auto">If multiple networks have to access an URL, an extra acl with source ip defined is setup up also</p>
</li>
<li>
<p dir="auto">All other requests not matching an URL <em>and</em> an IP get dropped</p>
</li>
</ul>
<p dir="auto">Now the pfsense acl syntax usually not requires an AND-operator, however, when having multiple urls and subnets, the acl syntax gets more  complex.<br />
Haproxy offers a way of grouping OR-requirements using (). So instead of using</p>
<pre><code>acl_url1 acl_ip1 || acl_url1 acl_ip2 || acl_url2 acl_ip1 etc.
</code></pre>
<p dir="auto">I could do:</p>
<pre><code>(acl_url1 || acl url2 ) (acl_ip1 || acl_ip2) etc.
</code></pre>
<p dir="auto">The acl fiels is a one-line small input field in the UI, making it difficult to read so I have to stick to a text editor and copy-paste it afterwards.<br />
Also the ()-syntax is denied by the pfsense-gui when applying the haproxy.cfg by saying "unknown acl …".</p>
<p dir="auto">I strongly suggest this to be changed so acls can be set up more easily and being kept compact like they used to be when working with a normal haproxy configuration created by hand. Also I would like to request the field to be made resizable or (at least) having a scroll-function.</p>
<ul>
<li>Julian</li>
</ul>
]]></description><link>https://forum.netgate.com/topic/114095/suggestion-for-haproxy-acl-xor-syntax</link><generator>RSS for Node</generator><lastBuildDate>Tue, 21 Apr 2026 17:04:18 GMT</lastBuildDate><atom:link href="https://forum.netgate.com/topic/114095.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 06 Apr 2017 08:41:47 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Suggestion for Haproxy ACL XOR syntax on Thu, 13 Apr 2017 09:33:48 GMT]]></title><description><![CDATA[<p dir="auto">Hi PiBa,</p>
<p dir="auto">dang I thought I realised it that way myself on an 1.7 HaProxy Cluster but you're obviously right - it's still not supported.  :-X Maybe I suggest this one to the haproxy community so they'll implement it first.</p>
]]></description><link>https://forum.netgate.com/post/693078</link><guid isPermaLink="true">https://forum.netgate.com/post/693078</guid><dc:creator><![CDATA[netcore]]></dc:creator><pubDate>Thu, 13 Apr 2017 09:33:48 GMT</pubDate></item><item><title><![CDATA[Reply to Suggestion for Haproxy ACL XOR syntax on Sat, 08 Apr 2017 18:04:25 GMT]]></title><description><![CDATA[<p dir="auto">Are you sure haproxy supports this?</p>
<p dir="auto">The webgui does not block you from entering this.<br />
And the error during applying the configuration is generated by haproxy itself.</p>
<p dir="auto">Make the config in he webgui so it rejects it, and then run "haproxy -c -f /var/etc/haproxy_test/haproxy.cfg" yourself from a console?<br />
Manually change the config file and run the command again? I have not found a working combination..</p>
<p dir="auto">Documentation of haproxy also doesn't give any clear examples of what you state is possible.</p>
<p dir="auto">p.s.<br />
May i suggest using networks-alias from firewall/aliases for keeping the list of ip's and subnets you want to allow? (you do need to restart haproxy after changing them..)</p>
]]></description><link>https://forum.netgate.com/post/692211</link><guid isPermaLink="true">https://forum.netgate.com/post/692211</guid><dc:creator><![CDATA[PiBa]]></dc:creator><pubDate>Sat, 08 Apr 2017 18:04:25 GMT</pubDate></item></channel></rss>