privatecoffee-website/Caddyfile
Kumi 742ec4668e
Refactor Caddyfile routing directives
Simplified the routing and handling directives in the Caddyfile by removing explicit regular expressions for HTML files and reorganizing asset handling. All requests are now served with a more generalized approach, improving readability and potential maintainability of the server configuration. This change encapsulates asset file serving and reverse proxying under specific handles, ensuring a cleaner and more structured configuration.
2023-12-31 14:37:59 +01:00

26 lines
897 B
Caddyfile

private.coffee www.private.coffee {
header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload"
header Access-Control-Allow-Origin https://element.private.coffee
header Access-Control-Allow-Methods "GET"
header Access-Control-Allow-Headers "DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range"
header Access-Control-Expose-Headers "Content-Length,Content-Range"
header /.well-known/matrix/* Content-Type application/json
header /.well-known/matrix/* Access-Control-Allow-Origin *
respond /.well-known/matrix/server `{"m.server": "matrix.private.coffee:443"}`
respond /.well-known/matrix/client `{"m.homeserver":{"base_url":"https://matrix.private.coffee"}}`
@assets {
path assets /assets/*
}
handle @assets {
file_server
root * /srv/private.coffee
}
handle {
reverse_proxy * unix//var/run/uwsgi/privatecoffee.sock
}
}