Haproxy : Les ACLs

De www.yakakliker.org
ACL Description
if { path_beg /api/ } Route API requests.
if { path_end .jpg .png } Route requests for images.
if { hdr(host) -m dom example.local } Routes requests for the domain example.local.
if { src 127.0.0.1/8 } Route requests originating from the given IP address range.
if { method POST PUT } Route POST and PUT requests.
if { url_param(region) europe } Route requests that have a URL parameter named region that is set to europe.

Syntaxe basique

frontend www
  bind :80
  acl images_url path -i -m beg /images/

In this example:

  • The name assigned to the ACL is images_url.
  • The path argument returns the URL path that the client requested. Function like path are called fetch methods.
  • The -i flag performs a case-insensitive match of the requested URL path.
  • The -m beg flag means that the match type is begins with.
  • Note that an ACL on its own performs no action. Later, you will see how to pair it with an action.


Liens

https://www.haproxy.com/blog/introduction-to-haproxy-acls

https://www.haproxy.com/documentation/haproxy-configuration-tutorials/proxying-essentials/custom-rules/acls/


compteur web gratuit sans pub