Skip to content

Instantly share code, notes, and snippets.

@tcheneau
Created October 24, 2017 21:34
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tcheneau/1f93d0b340a134f8a97bc35f2deb7662 to your computer and use it in GitHub Desktop.
Save tcheneau/1f93d0b340a134f8a97bc35f2deb7662 to your computer and use it in GitHub Desktop.
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