mirror of
https://github.com/caddyserver/website.git
synced 2025-04-22 21:16:15 -04:00
docs: v2.6.2 changes
This commit is contained in:
parent
5282fbd6ff
commit
0d05c7bf19
2 changed files with 14 additions and 7 deletions
|
@ -64,14 +64,13 @@ If you want to provide custom error pages only for some error codes, you can che
|
|||
|
||||
```caddy-d
|
||||
handle_errors {
|
||||
@custom_err file /err-{http.error.status_code}.html /err.html
|
||||
@custom_err file /err-{err.status_code}.html /err.html
|
||||
handle @custom_err {
|
||||
rewrite @custom_err {http.matchers.file.relative}
|
||||
rewrite * {file_match.relative}
|
||||
file_server
|
||||
}
|
||||
respond "{http.error.status_code} {http.error.status_text}"
|
||||
respond "{err.status_code} {err.status_text}"
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
Reverse proxy to a professional server that is highly qualified for handling HTTP errors and improving your day 😸:
|
||||
|
|
|
@ -155,6 +155,7 @@ format <encoder_module> {
|
|||
stacktrace_key <key>
|
||||
line_ending <char>
|
||||
time_format <format>
|
||||
time_local
|
||||
duration_format <format>
|
||||
level_format <format>
|
||||
}
|
||||
|
@ -179,6 +180,7 @@ format <encoder_module> {
|
|||
- **wall_nano** Example: `2006/01/02 15:04:05.000000000`
|
||||
- **common_log** Example: `02/Jan/2006:15:04:05 -0700`
|
||||
- Or, any compatible time layout string; see the [Go documentation](https://pkg.go.dev/time#pkg-constants) for full details.
|
||||
- **time_local** Logs with the local system time rather than the default of UTC time.
|
||||
- **duration_format** The format for durations. May be one of:
|
||||
- **seconds** Floating-point number of seconds elapsed; this is the default.
|
||||
- **nano** Integer number of nanoseconds elapsed.
|
||||
|
@ -251,7 +253,11 @@ Marks a field to be replaced with the provided string at encoding time.
|
|||
|
||||
##### ip_mask
|
||||
|
||||
Masks IP addresses in the field using a CIDR mask, i.e. the number of bits from the IP to retain, starting from the left side. There is separate configuration for IPv4 and IPv6 addresses. Most commonly, the field to filter would be `request>remote_ip`.
|
||||
Masks IP addresses in the field using a CIDR mask, i.e. the number of bits from the IP to retain, starting from the left side. If the field is an array of strings (e.g. HTTP headers), each value in the array is masked. The value may be a comma separated string of IP addresses.
|
||||
|
||||
There is separate configuration for IPv4 and IPv6 addresses, since they have a different total number of bits.
|
||||
|
||||
Most commonly, the fields to filter would be `request>remote_ip` for the directly connecting client, or `request>headers>X-Forwarded-For` if behind a reverse proxy.
|
||||
|
||||
```caddy-d
|
||||
<field> ip_mask {
|
||||
|
@ -296,7 +302,7 @@ If many actions are defined for the same cookie name, only the first action will
|
|||
|
||||
##### regexp
|
||||
|
||||
Marks a field to have a regular expression replacement applied at encoding time.
|
||||
Marks a field to have a regular expression replacement applied at encoding time. If the field is an array of strings (e.g. HTTP headers), each value in the array has replacements applied.
|
||||
|
||||
```caddy-d
|
||||
<field> regexp <pattern> <replacement>
|
||||
|
@ -308,7 +314,9 @@ In the replacement string, capture groups can be referenced with `${group}` wher
|
|||
|
||||
##### hash
|
||||
|
||||
Marks a field to be replaced with the first 4 bytes of the SHA-256 hash of the value at encoding time. Useful to obscure the value if it's sensitive, while being able to notice whether each request had a different value.
|
||||
Marks a field to be replaced with the first 4 bytes (8 hex characters) of the SHA-256 hash of the value at encoding time. If the field is a string array (e.g. HTTP headers), each value in the array is hashed.
|
||||
|
||||
Useful to obscure the value if it's sensitive, while being able to notice whether each request had a different value.
|
||||
|
||||
```caddy-d
|
||||
<field> hash
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue