67 lines
1.4 KiB
Caddyfile
67 lines
1.4 KiB
Caddyfile
(security) {
|
|
header * {
|
|
-Server
|
|
-Date
|
|
|
|
Strict-Transport-Security "max-age=31536000; includeSubDomains"
|
|
Feature-Policy "geolocation none;midi none;notifications none;push none;sync-xhr none;microphone none;camera none;magnetometer none;gyroscope none;speaker self;vibrate none;fullscreen self;payment none;"
|
|
X-Content-Type-Options "nosniff"
|
|
X-Frame-Options "DENY"
|
|
X-XSS-Protection "1; mode=block"
|
|
Referrer-Policy "no-referrer-when-downgrade"
|
|
}
|
|
}
|
|
|
|
simplenotes.be {
|
|
@static {
|
|
path *.css *.js
|
|
file
|
|
}
|
|
|
|
@fonts {
|
|
path *.woff *.woff2
|
|
file
|
|
}
|
|
|
|
@404 {
|
|
expression {http.error.status_code} == 404
|
|
}
|
|
|
|
route /* {
|
|
file_server
|
|
}
|
|
|
|
handle_errors {
|
|
rewrite @404 /404.html
|
|
file_server
|
|
import security
|
|
}
|
|
|
|
route /api/* {
|
|
uri strip_prefix /api
|
|
reverse_proxy http://api:8081
|
|
}
|
|
|
|
header @static Cache-Control "public, max-age=31536000" # 1 year
|
|
header @fonts Cache-Control "public, max-age=604800" # 7 days
|
|
header Content-Security-Policy "default-src 'self' 'unsafe-inline';"
|
|
|
|
encode gzip
|
|
root * /site
|
|
log
|
|
|
|
import security
|
|
}
|
|
|
|
www.simplenotes.be {
|
|
redir * https://simplenotes.be{path}
|
|
}
|
|
|
|
docs.simplenotes.be {
|
|
file_server
|
|
root * /docs
|
|
import security
|
|
|
|
header Content-Security-Policy "default-src 'self' 'unsafe-inline' https://cdn.jsdelivr.net;"
|
|
}
|