mirror of
https://github.com/caddyserver/website.git
synced 2025-05-06 19:57:13 -04:00
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:
parent
a7e10b9e87
commit
2718fc3b7f
1 changed files with 27 additions and 0 deletions
|
@ -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`
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue