Skip to content

Instantly share code, notes, and snippets.

@tcheneau
Created Oct 24, 2017
Embed
What would you like to do?
Caddy configuration for mastodon (for my own instance) (ripped off from https://gist.github.com/yukimochi/bb7c90cbe628f216f821e835df1aeac1)
https://social.amnesiak.org {
log /var/lib/caddy/data/social.amnesiak.org-access.log
errors /var/lib/caddy/data/social.amnesiak.org-access.err
root /data/mastodon/public
gzip
header / {
Strict-Transport-Security "max-age=31536000;"
}
header /emoji Cache-Control "public, max-age=31536000, immutable"
header /packs Cache-Control "public, max-age=31536000, immutable"
header /system/accounts/avatars Cache-Control "public, max-age=31536000, immutable"
header /system/media_attachments/files Cache-Control "public, max-age=31536000, immutable"
errors {
* 500.html
}
rewrite {
if {path} is /
to /proxy{path}
}
rewrite {
if {path} not_has /api/v1/streaming
to {path} /proxy{path}
}
proxy /proxy localhost:3000 {
without /proxy
transparent
websocket
}
proxy /api/v1/streaming localhost:4000 {
transparent
websocket
}
tls {
protocols tls1.2
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment