HAProxy community

Frontend statement syntax


#1

I have a simple question that I have not been to find in the HAProxy “Getting Started” and “Configuration Manual” docs or by searching the web. The question I have regards the syntax of the frontend statement. I have seen a few examples online similar to the following:

frontend http
   bind :80

And other examples like this:

frontend https-in *:443
    mode tcp
    bind *:8443

What is the effect of having the address:port in the frontend definition? I am sure that I am just missing the obvious, but I can not find the syntax definition for the frontend statement anywhere. I would appreciate it if someone could recommend good references for learning the basics of HAProxy configuration.


#2

That is simply an invalid syntax that Haproxy will ignore on startup:

[ALERT] 132/094159 (5219) : parsing [../cert/haproxy.cfg:45] : 'frontend' cannot handle unexpected argument '*:443'.
[ALERT] 132/094159 (5219) : parsing [../cert/haproxy.cfg:45] : please use the 'bind' keyword for listening addresses.

This confusing configuration syntax is long gone and is not supported anymore. Only configure listening ports with the bind directive, just as the official documentation suggests. Ignore obsolete blog posts on the Internet and stick to the actual documentation.