简体   繁体   中英

can you whitelist urls with haproxy?

Hello I want to white list certain urls in haproxy such as

Only foobar.com/mypages/* can be accessible.

Anything else under foobar.com should be blocked.

Does haproxy give you the capability to do that?

Thanks, Bob

You can try the following configuration to get the desired result :

#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

There are other path matching ACL directives: Path-directives .Use the one which suits your case best.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM