Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Search
    • Register
    • Login
    Introducing Netgate Nexus: Multi-Instance Management at Your Fingertips.

    haproxy acl path and method

    Scheduled Pinned Locked Moved Cache/Proxy
    4 Posts 2 Posters 1.9k Views 2 Watching
    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.
    • X
      Xivexell
      last edited by

      I'm trying to create a rule like this :

      path_beg /api/user/ && method GET

      I need specifically validate a URL and method it uses

      but it doesn't works, some ideas?

      P 1 Reply Last reply
      Reply Quote 0
      • P
        PiBa @Xivexell
        last edited by

        @Xivexell
        I would try something like this:

        acl check1 path_beg /api/user/
        acl check2 method GET
        http-request deny 404 if check1 check2
        
        X 1 Reply Last reply
        Reply Quote 0
        • X
          Xivexell @PiBa
          last edited by

          Thanks for your answer, I try it, works when I have one path, but If I have other rules, it doesn't works c992ce7a-1e0a-400c-bb3d-d8af8957eda1-imagen.png

          P 1 Reply Last reply
          Reply Quote 0
          • P
            PiBa @Xivexell
            last edited by

            @Xivexell
            I notice that you have the "NOT" checkbox set.. So i wonder what you expect to happen.?

            If the user is 'NOT requesting /api/user' AND the user is 'NOT using method GET/POST/DELETE' then do something.?

            Or would you perhaps prefer to have and 'OR' = || between those 2 acls.?

            add0a4e8-3533-48fe-a796-f6a808eb60ec-image.png
            Result in haproxy.cfg (see the ! signs and the | ..):

            	acl			Rule1	var(txn.txnpath) -m beg -i /api/user/
            	acl			Rule2	method GET POST DELETE
            	http-request deny deny_status 402  if  !Rule1 || !Rule2 
            
            1 Reply Last reply
            Reply Quote 0

            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

            With your input, this post could be even better 💗

            Register Login
            • First post
              Last post
            Copyright 2026 Rubicon Communications LLC (Netgate). All rights reserved.
            Privacy Policy · Cookie Policy