Repository navigation
Expand file tree
/
Copy pathCaddyfile
More file actions
137 lines (119 loc) · 2.84 KB
/
Copy pathCaddyfile
File metadata and controls
137 lines (119 loc) · 2.84 KB
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
# https://caddyserver.com/docs/caddyfile/options
{
admin off
email {{ config "caddy-email" }}
log {
format console
}
}
(common) {
header -Server
header Strict-Transport-Security max-age=31536000;
header X-Content-Type-Options nosniff
request_body {
max_size 10MB
}
#log {
# format console
#}
handle_errors {
root * /srv/www/templates/
rewrite * /error_template.html
templates
file_server
header Cache-Control no-cache
header Content-Type "text/html; charset=utf-8"
}
rewrite /favicon.ico /img/favicon.ico
file_server /img/favicon.ico {
root /srv/www/static
}
}
(static-robots) {
file_server /robots.txt {
root /srv/www/static
}
}
{{ config "inyoka-base-domain" }},
forum.{{ config "inyoka-base-domain" }},
paste.{{ config "inyoka-base-domain" }},
wiki.{{ config "inyoka-base-domain" }},
planet.{{ config "inyoka-base-domain" }},
ikhaya.{{ config "inyoka-base-domain" }} {
@exclude {
not path /img/favicon.ico
not path /robots.txt
}
reverse_proxy @exclude inyoka-worker:8000
import common
import static-robots
}
{{ config "inyoka-media-domain" }} {
root * /srv/www/media
file_server
import common
header Cache-Control max-age=2592000 # 30 days
@exclude {
not path /linkmap/*
not path /favicon.ico
not path /robots.txt
not path *.avif
not path *.gif
not path *.jpg
not path *.jpeg
not path *.pdf
not path *.png
not path *.txt
not path *.webp
}
header @exclude Content-Type application/octet-stream
header @exclude Content-Disposition attachment # force download
}
{{ config "inyoka-static-domain" }} {
root * /srv/www/static
file_server {
precompressed gzip
}
import common
import static-robots
header Access-Control-Allow-Origin "*"
header Cache-Control max-age=2592000 # 30 days
}
# remove www
# https://caddyserver.com/docs/caddyfile/patterns#redirect-www-subdomain
www.{{ config "inyoka-base-domain" }} {
redir https://{{ config "inyoka-base-domain" }}{uri}
import common
}
www.forum.{{ config "inyoka-base-domain" }} {
redir https://forum.{{ config "inyoka-base-domain" }}{uri}
import common
}
www.paste.{{ config "inyoka-base-domain" }} {
redir https://paste.{{ config "inyoka-base-domain" }}{uri}
import common
}
www.wiki.{{ config "inyoka-base-domain" }} {
redir https://wiki.{{ config "inyoka-base-domain" }}{uri}
import common
}
www.planet.{{ config "inyoka-base-domain" }} {
redir https://planet.{{ config "inyoka-base-domain" }}{uri}
import common
}
www.ikhaya.{{ config "inyoka-base-domain" }} {
redir https://ikhaya.{{ config "inyoka-base-domain" }}{uri}
import common
}
www.{{ config "inyoka-static-domain" }} {
redir https://{{ config "inyoka-static-domain" }}{uri}
import common
}
www.{{ config "inyoka-media-domain" }} {
redir https://{{ config "inyoka-media-domain" }}{uri}
import common
}
# used for docker health check
http://localhost:2024 {
respond "caddy works"
}