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.

Revisions

  1. namazso created this gist Feb 21, 2024.
    38 changes: 38 additions & 0 deletions config.json
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,38 @@
    {
    "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
    },