mirror of
https://github.com/caddyserver/website.git
synced 2025-04-20 12:15:08 -04:00
add match block example
This commit is contained in:
parent
6013d7f7ed
commit
c71a3d7831
1 changed files with 13 additions and 0 deletions
|
@ -150,6 +150,19 @@ header {
|
|||
reverse_proxy upstream:443
|
||||
```
|
||||
|
||||
Mark light mode responses as separately cacheable from dark mode responses if the upstream server supports client hints:
|
||||
```caddy-d
|
||||
header {
|
||||
Cache-Control "max-age=3600"
|
||||
Vary "Sec-CH-Prefers-Color-Scheme"
|
||||
match {
|
||||
header Accept-CH "*Sec-CH-Prefers-Color-Scheme*"
|
||||
header Critical-CH "Sec-CH-Prefers-Color-Scheme"
|
||||
}
|
||||
}
|
||||
reverse_proxy upstream:443
|
||||
```
|
||||
|
||||
Prevent overly-permissive CORS headers by replacing wildcard values with a specific domain:
|
||||
```caddy-d
|
||||
header >Access-Control-Allow-Origin "\*" "allowed-partner.com"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue