mirror of
https://github.com/caddyserver/website.git
synced 2025-04-21 12:36:16 -04:00
docs: Improve the log example to cover hiding IPs (#101)
This commit is contained in:
parent
785ffebb23
commit
84ced83c0b
1 changed files with 2 additions and 1 deletions
|
@ -227,13 +227,14 @@ log {
|
|||
}
|
||||
```
|
||||
|
||||
Mask the remote address from the request, keeping the first 16 bytes (i.e. 255.255.0.0) for IPv4 addresses, and the first 64 bytes from IPv6 addresses:
|
||||
Mask the remote address from the request, keeping the first 16 bytes (i.e. 255.255.0.0) for IPv4 addresses, and the first 64 bytes from IPv6 addresses, and also deletes the `common_log` field which would normally contain an unmasked IP address:
|
||||
|
||||
```caddy-d
|
||||
log {
|
||||
format filter {
|
||||
wrap console
|
||||
fields {
|
||||
common_log delete
|
||||
request>remote_addr ip_mask {
|
||||
ipv4 24
|
||||
ipv6 32
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue