Add note about listener_address matching

Explains that an exact match is required to apply settings to specific listeners when using bind and default_bind directives
This commit is contained in:
Daniel Santos 2023-02-09 09:58:38 -07:00 committed by Francis Lavoie
parent a7e10b9e87
commit 2718fc3b7f
No known key found for this signature in database
GPG key ID: 29B92EA7430C3C62

View file

@ -400,6 +400,33 @@ http:// {
} }
``` ```
<aside class="tip">
If you are defining the [`bind` directive](/docs/caddyfile/directives/bind) inside a site or the [`default_bind` global option](/docs/caddyfile/options#default_bind), the `servers [<listener_address>]` block *MUST* match the address defined on either directives, otherwise the settings won't be applied.
</aside>
For example:
```caddy
{
servers :8080 { <--- THIS WILL NOT MATCH ANY LISTENER
name private
}
servers 192.168.1.2:8080 { <--- THIS WILL WORK BECAUSE IS AN EXACT MATCH
name public
}
}
:8080 {
bind 127.0.0.1
}
:8080 {
bind 192.168.1.2
}
```
##### `listener_wrappers` ##### `listener_wrappers`