Unix socket permissions

This commit is contained in:
Francis Lavoie 2023-11-23 05:27:20 -05:00
parent 1e92385d6e
commit c85637a103
No known key found for this signature in database
GPG key ID: 0F66EE1687682239

View file

@ -39,6 +39,7 @@ The address part may be any of these forms:
- `host:port`
- `:port`
- `/path/to/unix/socket`
- `/path/to/unix/socket|0660`
The host may be any hostname, resolvable domain name, or IP address.
@ -46,6 +47,8 @@ The port may be a single value (`:8080`) or an inclusive range (`:8080-8085`). A
A unix socket path is only acceptable when using a `unix*` network type. The forward slash that separates the network and address is not considered part of the path.
When a unix socket is used as a bind address, you may optionally specify a file permission mode after the path, separated by a pipe `|`. The default is `0660` (octal), i.e. `u=rw,g=rw,o=`. The leading `0` is optional.
Valid examples:
```
@ -57,6 +60,7 @@ tcp/localhost:8080
tcp/localhost:8080-8085
udp/localhost:9005
unix//path/to/socket
unix//path/to/socket|0660
```
<aside class="tip">
@ -66,6 +70,8 @@ Caddy network addresses are not URLs. URLs couple the lower and higher layers of
</aside>
## Placeholders
Caddy's configuration supports the use of _placeholders_ (variables). Using placeholders is a simple way to inject dynamic values into a static configuration.
@ -101,6 +107,8 @@ Placeholder | Description
Not all config fields support placeholders, but most do where you would expect it.
## File locations
This section contains information about where to find various files. File and directory paths described here are defaults at best; some can be overridden.