Url rewriting 你能用haproxy将URL列入白名单吗?

Url rewriting 你能用haproxy将URL列入白名单吗?,url-rewriting,reverse-proxy,haproxy,whitelist,blacklist,Url Rewriting,Reverse Proxy,Haproxy,Whitelist,Blacklist,你好,我想在haproxy中列出某些URL,例如 只有foobar.com/mypages/*可以访问 foobar.com下的任何其他内容都应该被阻止 haproxy能让你做到这一点吗 谢谢, Bob您可以尝试以下配置以获得所需的结果: #Will set the ACL if path matches acl allowed_url path_reg */mypages/* #Based on the previouslt set ACL , we can reject or allow

你好,我想在haproxy中列出某些URL,例如

只有foobar.com/mypages/*可以访问

foobar.com下的任何其他内容都应该被阻止

haproxy能让你做到这一点吗

谢谢,
Bob

您可以尝试以下配置以获得所需的结果:

#Will set the ACL if path matches
acl allowed_url path_reg */mypages/*

#Based on the previouslt set ACL , we can reject or allow connections
#Accept/whitelist if matches
tcp_request connection accept if allowed_url
#Reject if not
tcp_request connection reject if !allowed_url
还有其他路径匹配ACL指令:。请使用最适合您的情况的指令