To have HAProxy functionally configured, you will need the "frontend" or "listen" directives. These are the only directives that will respond to incoming requests. The backend directive provides only a way to route traffic for a proxy.
To say, here are the entries you need in the 'frontend' or 'listen' directive to achieve your goals:
acl white_list src 192.168.1.0/24 192.168.10.0/24
tcp-request content accept if white_list
tcp-request content reject
These directives will only allow traffic coming from the 192.168.1 / 24 and 192.168.10 / 24 subnets.
Jason source
share