SimpleNotes/Caddyfile
2020-06-26 02:38:45 +02:00

103 lines
2.0 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"
}
}
(common) {
@ignore {
path *.php
}
respond @ignore "no" 404
encode gzip
}
(nuxt) {
@nuxt {
path /_nuxt/*
}
header @nuxt Cache-Control "public, max-age=31536000" # 1 year
}
simplenotes.be {
import security
import nuxt
import common
@404 {
expression {http.error.status_code} == 404
}
handle_errors {
rewrite @404 /404.html
file_server
import security
}
route /* {
file_server
}
route /api/* {
uri strip_prefix /api
reverse_proxy http://localhost:8081
}
header Content-Security-Policy "default-src 'self' 'unsafe-inline';"
root * /var/www/simplenotes.be
log {
output file /var/log/www/simplenotes.be.json
format json
}
}
www.simplenotes.be {
redir * https://simplenotes.be{path}
}
docs.simplenotes.be {
import security
import common
file_server
root * /var/www/docs.simplenotes.be
log {
output file /var/log/www/docs.simplenotes.be.json
format json
}
header Content-Security-Policy "default-src 'self' 'unsafe-inline' https://cdn.jsdelivr.net;"
}
portfolio.simplenotes.be {
import security
import common
import nuxt
file_server
root * /var/www/portfolio.simplenotes.be
log {
output file /var/log/www/portfolio.simplenotes.be.json
format json
}
# header Content-Security-Policy "default-src 'self' 'unsafe-inline' https://cdn.jsdelivr.net;"
}