Created
October 24, 2017 21:34
-
-
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)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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