From 2718fc3b7fa6f61fbc0098a330a5c3a44e87a0ff Mon Sep 17 00:00:00 2001 From: Daniel Santos Date: Thu, 9 Feb 2023 09:58:38 -0700 Subject: [PATCH] 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 --- src/docs/markdown/caddyfile/options.md | 27 ++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/docs/markdown/caddyfile/options.md b/src/docs/markdown/caddyfile/options.md index adc253b..041b362 100644 --- a/src/docs/markdown/caddyfile/options.md +++ b/src/docs/markdown/caddyfile/options.md @@ -400,6 +400,33 @@ http:// { } ``` + + +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`