mirror of
https://github.com/caddyserver/website.git
synced 2025-04-25 14:36:16 -04:00
Update bind.md
This commit is contained in:
parent
6db3af5c32
commit
e590d29117
1 changed files with 37 additions and 1 deletions
|
@ -16,10 +16,13 @@ Note that binding sites inconsistently may result in unintended consequences. Fo
|
|||
## Syntax
|
||||
|
||||
```caddy-d
|
||||
bind <hosts...>
|
||||
bind <hosts...> {
|
||||
protocols <protocol> ...
|
||||
}
|
||||
```
|
||||
|
||||
- **<hosts...>** is the list of host interfaces to bind which to bind the listener.
|
||||
- **<protocols...>** is an optional override of the HTTP protocols to enable for the listener.
|
||||
|
||||
|
||||
## Examples
|
||||
|
@ -64,6 +67,39 @@ example.com {
|
|||
}
|
||||
```
|
||||
|
||||
To bind to a Unix domain socket at `/run/caddy/stream.sock` that serves h1 and h2, and another at `/run/caddy/dgram.sock` that serves h3:
|
||||
|
||||
```caddy
|
||||
example.com {
|
||||
bind unix//run/caddy/stream.sock {
|
||||
protocols h1 h2
|
||||
}
|
||||
bind unixgram//run/caddy/dgram.sock {
|
||||
protocols h3
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
To bind to inherited descriptors specified with [environment placeholders](/docs/conventions#placeholders):
|
||||
|
||||
```caddy
|
||||
http://example.com {
|
||||
bind fd/{env.CADDY_HTTP_FD} {
|
||||
protocols h1
|
||||
}
|
||||
redir https://example.com{uri} permanent
|
||||
}
|
||||
|
||||
https://example.com {
|
||||
bind fd/{env.CADDY_HTTPS_FD} {
|
||||
protocols h1 h2
|
||||
}
|
||||
bind fdgram/{env.CADDY_HTTP3_FD} {
|
||||
protocols h3
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
To bind one domain to two different interfaces, with different responses:
|
||||
|
||||
```caddy
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue