Add listen directive
This provides a multi-line way to list addresses.
This commit is contained in:
parent
826cbd7fe1
commit
d1812162a8
|
@ -59,7 +59,12 @@ func parseFrontend(srv *Server, d *scfg.Directive) error {
|
|||
frontend.Protocols = protocolDirective.Params
|
||||
}
|
||||
|
||||
for _, addr := range d.Params {
|
||||
addresses := append([]string(nil), d.Params...)
|
||||
for _, listenDirective := range d.Children.GetAll("listen") {
|
||||
addresses = append(addresses, listenDirective.Params...)
|
||||
}
|
||||
|
||||
for _, addr := range addresses {
|
||||
host, port, err := net.SplitHostPort(addr)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to parse frontend address %q: %v", addr, err)
|
||||
|
|
|
@ -49,6 +49,9 @@ The following directives are supported:
|
|||
|
||||
The frontend directive supports the following sub-directives:
|
||||
|
||||
*listen* <address>...
|
||||
Additional addresses to listen on.
|
||||
|
||||
*backend* <uri>...
|
||||
Backend to forward incoming connections to.
|
||||
|
||||
|
|
Loading…
Reference in New Issue