Cannot restrict traffic, how to http-request deny allow !path || !path2 !networks

haproxy version: 2.2.7

I can restrict accessing to selected /path only, but how to also allow access to /somepath from specific network besides that?

Config example:

acl network_allowed src 1.2.3.4/10
acl allowed_pages path_beg /allow
acl allowed_page_for_ip path_beg /only-from-specific-ip

Works, only the allowed path is accessible:

http-request deny if !allowed_pages

This does not work, either of the paths is accessible:

http-request deny if !allowed_pages || !allowed_page_for_ip

This is what I need. But currently it is not working:

http-request deny if !allowed_pages || !allowed_page_for_ip !network_allowed


…I have also tried with multiline with no luck, like

http-request deny if !allowed_pages
http-request deny if !allowed_page_for_ip

Answering to myself…
Well, allowing (logically) is the way to go, here is what I ended up:

acl network_allowed src 1.2.3.4/10
acl allowed_pages path_beg /allow
acl allowed_page_for_ip path_beg /only-from-specific-ip
http-request allow if allowed_pages
http-request allow if allowed_page_for_ip network_allowed
#deny others
http-request deny