Hi,

On Wed, Mar 19, 2014 at 10:44:09AM +0530, kavita Sanap wrote:
> Hi,
> 
> We are using HAProxy 1.5dev22 on linux machine.
> Added acl rule for geolocation feature for routing traffic based on country
> code . But getting below error when trying to start haproxy
> 
> [ALERT] 077/050608 (16394) : parsing [WebsiteHAProxy.cfg:31] : error
> detected while parsing ACL 'acl_in' : unknown fetch method '%[src' in ACL
> expression '%[src,'.
> [ALERT] 077/050608 (16394) : parsing [WebsiteHAProxy.cfg:37] : error
> detected while parsing switching rule : no such ACL : 'acl-in'.
> [ALERT] 077/050608 (16394) : Error(s) found in configuration file :
> WebsiteHAProxy.cfg
> [ALERT] 077/050608 (16394) : Fatal errors found in configuration.
> 
> 
> Please find below haproxy.cfg we are using for haproxy 1.5
> 
> global
> log 127.0.0.1 local0
> log 127.0.0.1 local1 notice
> maxconn 25000
> quiet
> pidfile /var/run/haproxy-private.pid
> defaults
> #geolocate src /etc/haproxy/geolocation.txt
> mode http
> log global
> option httplog
> option tcplog
> option dontlognull
> option forwardfor
> stats enable
> stats refresh 10
> stats auth test:test123
> retries 3
> option redispatch
> maxconn 25000
> contimeout 5000
> clitimeout 50000
> srvtimeout 50000
> option httpclose
> 
> frontend homemonitor
> bind 0.0.0.0:80
> acl acl_in %[src, map_ip(/etc/haproxy/geolocation.txt)] -m str -i IN


There is no "%" to use here, this format is for log-format and http-headers
only!

Please use this instead :

    acl acl_in src,map_ip(/etc/haproxy/geolocation.txt) -m str -i IN

Willy


Reply via email to