You add one or more
bind lines to your
listen sections to receive client connections. Assign to it an IP address and port on which to listen.
In the following example, we define a frontend named myproxy and bind to the IP address 10.0.0.5 on port 80:
frontend myproxy bind 10.0.0.5:80 # other settings not shown...
On some servers there may be more than one IP address assigned. If you wish to listen on a certain port, but don't care which IP address, then omit the address. In the following example, we receive traffic on any IP address assigned to the server at port 80:
frontend myproxy bind :80
The same frontend can listen on multiple IP addresses and/or ports, as shown below:
frontend myproxy bind :80 bind :8080 bind 127.0.0.1:9999
However, only one frontend can lay claim to a particular IP address and port. Once it has bound to it, other
listen sections cannot bind to that same IP address and port combination.
You can also specify a range of ports. In the following example, the load balancer listens on any port between 2000 and 2100, inclusive:
frontend myproxy bind 10.0.0.5:2000-2100
bind directive accepts IPv4 and IPv6 IP addresses. To specify that you would like to listen on all IPv6 addresses, add an extra colon before the port:
frontend myproxy bind ::80
Next upBind Reference