<?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[HAProxy: Rules based on url?]]></title><description><![CDATA[<p dir="auto">I have a CRM/ERP System called ERPNext behind my firewall.</p>
<p dir="auto">ERPNext includes a front-end website, as well as the backend for the business-specific applications.</p>
<p dir="auto">I'd like to restrict example.com/app/* (the backend for business users) to specific IP addresses (basically my LAN or VPN'd into the LAN), while if the destination is example.com/'anything-but-app'* (the website) can accept connections from any IP address.</p>
<p dir="auto">Is this possible with HAProxy?</p>
]]></description><link>https://forum.netgate.com/topic/189427/haproxy-rules-based-on-url</link><generator>RSS for Node</generator><lastBuildDate>Fri, 10 Apr 2026 22:50:22 GMT</lastBuildDate><atom:link href="https://forum.netgate.com/topic/189427.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 31 Jul 2024 23:28:43 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to HAProxy: Rules based on url? on Thu, 01 Aug 2024 13:44:33 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/oguruma">@<bdi>oguruma</bdi></a> said in <a href="/post/1178904">HAProxy: Rules based on url?</a>:</p>
<blockquote>
<p dir="auto">I'd like to restrict example.com/app/* (the backend for business users) to specific IP addresses (basically my LAN or VPN'd into the LAN), while if the destination is example.com/'anything-but-app'* (the website) can accept connections from any IP address.</p>
</blockquote>
<p dir="auto">These are two rules in fact. Do you really need both of them?</p>
<p dir="auto">Assuming it is sufficient to restrict access to example.com/app/*, you can do it this way:</p>
<p dir="auto">In Firewall &gt; Aliases create an alias for the allowed networks, say AllowedNets.</p>
<p dir="auto">Then create an ACL, call it "AllowedNets", "Source IP matches IP or Aliases", check "Not" and state AllowedNets as value.</p>
<p dir="auto">If you also need to limit the rule to the certain host create an "host matches" ACL and put example.com into the value box. Call it MyHost.</p>
<p dir="auto">Add an ACL, say "MyPath", "Path starts with" "/app/".</p>
<p dir="auto">Create an action "http-request deny", in the condition ACL box insert "MyHost MyPath AllowedNets" (all the ACL you've created before, separated by spaces).</p>
]]></description><link>https://forum.netgate.com/post/1178938</link><guid isPermaLink="true">https://forum.netgate.com/post/1178938</guid><dc:creator><![CDATA[viragomann]]></dc:creator><pubDate>Thu, 01 Aug 2024 13:44:33 GMT</pubDate></item></channel></rss>