我试图限制访问特定的url。 它不应该被允许访问/admin.php。
frontend example acl restricted_page path_beg -i /admin\.php http-request deny if restricted_page
这工作正常,HAProxy阻止访问此url。 但是,当我inputhttp://example.org/ad%6Din.php(%6D =“m”的hex代码)时,HAProxy不限制访问。
做这个的最好方式是什么?
谢谢!
碰巧,HAProxy有一个转换器来解码字段,确保你的ACL总是匹配给定的string。
url_dec
采用提供的url编码string作为input,并返回解码版本作为输出。 input和输出是stringtypes。
你会这样使用它。
frontend example acl restricted_page path_beg,url_dec -i /admin.php http-request deny if restricted_page