2021-10-14 10:47:23 +00:00
|
|
|
# Global configuration
|
|
|
|
{
|
|
|
|
{{ patch("caddyfile-global")|indent(4) }}
|
|
|
|
}
|
|
|
|
|
|
|
|
# proxy directive snippet (with logging) to be used as follows:
|
|
|
|
#
|
|
|
|
# import proxy "containername:port"
|
|
|
|
(proxy) {
|
|
|
|
log {
|
|
|
|
output stdout
|
|
|
|
format filter {
|
|
|
|
wrap json
|
|
|
|
fields {
|
|
|
|
common_log delete
|
|
|
|
request>headers delete
|
|
|
|
resp_headers delete
|
|
|
|
tls delete
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-10-18 12:10:59 +00:00
|
|
|
# This will compress requests that matches the default criteria set by Caddy.
|
|
|
|
# see https://caddyserver.com/docs/caddyfile/directives/encode
|
|
|
|
# for information about the defaults; i.e. how/when this will be applied.
|
|
|
|
encode gzip
|
|
|
|
|
2021-10-14 10:47:23 +00:00
|
|
|
reverse_proxy {args.0} {
|
2021-02-26 11:33:24 +00:00
|
|
|
header_up X-Forwarded-Port {{ 443 if ENABLE_HTTPS else 80 }}
|
|
|
|
}
|
2020-09-17 10:53:14 +00:00
|
|
|
}
|
2021-10-14 10:47:23 +00:00
|
|
|
|
2021-11-09 10:30:00 +00:00
|
|
|
{{ LMS_HOST }}{$default_site_port}, {{ PREVIEW_LMS_HOST }}{$default_site_port} {
|
2021-10-14 10:47:23 +00:00
|
|
|
@favicon_matcher {
|
2022-01-20 13:29:00 +00:00
|
|
|
path_regexp ^/favicon.ico$
|
2021-10-14 10:47:23 +00:00
|
|
|
}
|
2022-01-20 13:29:00 +00:00
|
|
|
rewrite @favicon_matcher /theming/asset/images/favicon.ico
|
2021-10-14 10:47:23 +00:00
|
|
|
|
|
|
|
# Limit profile image upload size
|
2023-01-30 10:31:38 +00:00
|
|
|
handle_path /api/profile_images/*/*/upload {
|
|
|
|
request_body {
|
|
|
|
max_size 1MB
|
|
|
|
}
|
2021-10-14 10:47:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
import proxy "lms:8000"
|
|
|
|
|
|
|
|
{{ patch("caddyfile-lms")|indent(4) }}
|
2023-01-30 10:31:38 +00:00
|
|
|
|
|
|
|
handle_path /* {
|
|
|
|
request_body {
|
|
|
|
max_size 4MB
|
|
|
|
}
|
|
|
|
}
|
2020-09-17 10:53:14 +00:00
|
|
|
}
|
2021-10-14 10:47:23 +00:00
|
|
|
|
2021-11-09 10:30:00 +00:00
|
|
|
{{ CMS_HOST }}{$default_site_port} {
|
2021-10-14 10:47:23 +00:00
|
|
|
@favicon_matcher {
|
2022-01-20 13:29:00 +00:00
|
|
|
path_regexp ^/favicon.ico$
|
2021-10-14 10:47:23 +00:00
|
|
|
}
|
2022-01-20 13:29:00 +00:00
|
|
|
rewrite @favicon_matcher /theming/asset/images/favicon.ico
|
2021-10-14 10:47:23 +00:00
|
|
|
|
|
|
|
import proxy "cms:8000"
|
|
|
|
|
|
|
|
{{ patch("caddyfile-cms")|indent(4) }}
|
2023-01-30 10:31:38 +00:00
|
|
|
|
|
|
|
handle_path /* {
|
|
|
|
request_body {
|
|
|
|
max_size 250MB
|
|
|
|
}
|
|
|
|
}
|
2020-09-17 10:53:14 +00:00
|
|
|
}
|
|
|
|
|
2021-02-26 11:33:24 +00:00
|
|
|
{{ patch("caddyfile") }}
|