Skip to content

Instantly share code, notes, and snippets.

@namazso
Created February 21, 2024 01:52
Show Gist options
  • Save namazso/dc9c7c58eef43d55e8ec5a028cc42f73 to your computer and use it in GitHub Desktop.
Save namazso/dc9c7c58eef43d55e8ec5a028cc42f73 to your computer and use it in GitHub Desktop.
Syanpse matrix.org media piggyback for Caddy
{
"match": [
{
"host": [
"matrix.yourdomain.com"
],
"path": [
"/_matrix/media/*/download/*/*",
"/_matrix/media/*/download/*/*/*",
"/_matrix/media/*/thumbnail/*/*"
],
"not": [
{
"path": [
"/_matrix/media/*/download/yourdomain.com/*",
"/_matrix/media/*/download/yourdomain.com/*/*",
"/_matrix/media/*/thumbnail/yourdomain.com/*"
]
}
]
}
],
"handle": [
{
"handler": "static_response",
"headers": {
"Location": [
"https://matrix-federation.matrix.org{http.request.uri}"
],
"Access-Control-Allow-Origin": [
"*"
]
},
"status_code": 301
}
],
"terminal": true
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment