haproxy acl path and method
-
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?
-
@Xivexell
I would try something like this:acl check1 path_beg /api/user/ acl check2 method GET http-request deny 404 if check1 check2 -
Thanks for your answer, I try it, works when I have one path, but If I have other rules, it doesn't works

-
@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.?

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
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 LoginPrivacy Policy · Cookie Policy