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.
This commit is contained in:
parent
9c32a783c9
commit
742ec4668e
1 changed files with 8 additions and 8 deletions
14
Caddyfile
14
Caddyfile
|
@ -11,16 +11,16 @@ private.coffee www.private.coffee {
|
|||
respond /.well-known/matrix/server `{"m.server": "matrix.private.coffee:443"}`
|
||||
respond /.well-known/matrix/client `{"m.homeserver":{"base_url":"https://matrix.private.coffee"}}`
|
||||
|
||||
@html {
|
||||
path_regexp html /(.*).html
|
||||
}
|
||||
|
||||
reverse_proxy @html unix//var/run/uwsgi/privatecoffee.sock
|
||||
|
||||
@assets {
|
||||
path assets /assets/*
|
||||
}
|
||||
|
||||
handle @assets {
|
||||
file_server
|
||||
root @assets /srv/private.coffee
|
||||
root * /srv/private.coffee
|
||||
}
|
||||
|
||||
handle {
|
||||
reverse_proxy * unix//var/run/uwsgi/privatecoffee.sock
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue