Haproxy unknown keyword bind *:80 in frontend section

QkiZ asked:

I compiled Haproxy LTS 2.2 version from source with this command:


There was no error during compiling.
This is my Haproxy config:

    log local2

    chroot      /var/lib/haproxy
    pidfile     /var/run/haproxy.pid
    maxconn     4000
    user        haproxy
    group       haproxy
    # turn on stats unix socket
    stats socket /var/lib/haproxy/stats

    mode                    http
    log                     global
    option                  httplog
    option                  dontlognull
    option http-server-close
    option forwardfor       except
    option                  redispatch
    retries                 3
    timeout http-request    10s
    timeout queue           1m
    timeout connect         10s
    timeout client          1m
    timeout server          1m
    timeout http-keep-alive 10s
    timeout check           10s
    maxconn                 3000

frontend http-in
        acl gerrit hdr(host) -i gerrit.example.local
        acl jenkins hdr(host) -i jenkins.example.local
        use_backend gerrit if gerrit
        use_backend jenkins if jenkins

backend gerrit
        server gerrit

backend jenkins
        server jenkins

When I’m checking config with haproxy -c -q -V -f /etc/haproxy/haproxy.cfg command I’m getting following error:

[NOTICE] 226/130914 (35193) : haproxy version is 2.2.2
[NOTICE] 226/130914 (35193) : path to executable is /usr/sbin/haproxy
[ALERT] 226/130914 (35193) : parsing [/etc/haproxy/haproxy.cfg:33] : unknown keyword 'bind' in 'frontend' section
[ALERT] 226/130914 (35193) : Error(s) found in configuration file : /etc/haproxy/haproxy.cfg
[ALERT] 226/130914 (35193) : Fatal errors found in configuration.

I checked documentation and it’s allowed to use bind keyword in frontend section
http://cbonte.github.io/haproxy-dconv/2.2/configuration.html#bind (Alphabetically sorted keywords reference)

More mindfuck achieved when I commenting out bind keyword in frontend section. Then error says:

[WARNING] 226/132456 (36642) : config : frontend 'http-in' has no 'bind' directive. Please declare it as a backend if this was intended. 🤷

My answer:

This looks like you used some other whitespace character that looks like a space, but isn’t actually the normal space character, between bind and Try typing in the text again, but this time use a regular space (U+0020, ASCII 32).

View the full question and any other answers on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.