/
Caddyfile
69 lines (57 loc) · 1.43 KB
/
Caddyfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# 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
}
}
}
reverse_proxy {args.0} {
header_up X-Forwarded-Port {{ 443 if ENABLE_HTTPS else 80 }}
}
}
{% if ENABLE_HTTPS and ENABLE_WEB_PROXY %}
{% set port = "" %}
{# listening to https is disabled and we must only listen to http #}
{% else %}
{% set port = ":80" %}
{% endif %}
{{ LMS_HOST }}{{ port }}, {{ PREVIEW_LMS_HOST }}{{ port }} {
@favicon_matcher {
path_regexp ^(.*)/favicon.ico$
}
rewrite @favicon_matcher /static/images/favicon.ico
# Limit profile image upload size
request_body /api/profile_images/*/*/upload {
max_size 1MB
}
request_body {
max_size 4MB
}
import proxy "lms:8000"
{{ patch("caddyfile-lms")|indent(4) }}
}
{{ CMS_HOST }}{{ port }} {
@favicon_matcher {
path_regexp ^(.*)/favicon.ico$
}
rewrite @favicon_matcher /static/images/favicon.ico
request_body {
max_size 250MB
}
import proxy "cms:8000"
{{ patch("caddyfile-cms")|indent(4) }}
}
{{ patch("caddyfile") }}