-
Notifications
You must be signed in to change notification settings - Fork 1
/
Caddyfile
492 lines (476 loc) · 10.1 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
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
###################
# Global Settings #
###################
{
default_sni dulanic.com
order replace after encode
order webdav before file_server
}
############
# Snippets #
############
(proxyheaders) {
# 2022-04-25: https://www.cloudflare.com/ips-v4 & https://www.cloudflare.com/ips-v6
trusted_proxies private_ranges 173.245.48.0/20 103.21.244.0/22 103.22.200.0/22 103.31.4.0/22 141.101.64.0/18 108.162.192.0/18 190.93.240.0/20 188.114.96.0/20 197.234.240.0/22 198.41.128.0/17 162.158.0.0/15 104.16.0.0/13 104.24.0.0/14 172.64.0.0/13 131.0.72.0/22 2400:cb00::/32 2606:4700::/32 2803:f800::/32 2405:b500::/32 2405:8100::/32 2a06:98c0::/29 2c0f:f248::/32
flush_interval -1
# header_up X-Forwarded-For {vars.realip}
header_up X-Real-IP {vars.realip}
}
(headers) {
header {
Strict-Transport-Security "max-age=63072000; includeSubDomains; preload"
Content-Security-Policy "upgrade-insecure-requests"
Content-Security-Policy: default-src 'self' *.dulanic.com dulanic.cloudflareaccess.com theme-park.dev;
# X-Frame-Options "SAMEORIGIN"
X-Content-Type-Options "nosniff"
X-XSS-Protection "1; mode=block"
Referrer-Policy "strict-origin-when-cross-origin"
X-Robots-Tag "none"
}
}
(main) {
tls {$ACMEEMAIL} {
ca https://acme-v02.api.letsencrypt.org/directory
dns cloudflare {$CLOUDFLARE_API_TOKEN}
resolvers 1.0.0.1
}
log {
output file /data/logs/error.log {
roll_size 100MiB
roll_keep 10
roll_keep_for 2160h
}
format filter {
wrap json
fields {
common_log delete
request>tls delete
}
}
level error
}
@tor header Cf-Ipcountry T1
vars realip {remote_host}
@cf header Cf-Connecting-Ip *
vars @cf realip {header.Cf-Connecting-Ip}
respond /robots.txt 200 {
body "User-agent: *
Disallow: /
User-agent: AdsBot-Google
Disallow: /
User-agent: AdsBot-Google-Mobile
Disallow: /"
close
}
}
(webdav) {
basicauth {
{$BASICAUTH}
}
}
import subsites
###############
# dulanic.com #
###############
https://dulanic.com {
import main
import headers
root * /www/websites/dulanic.com
file_server
# reverse_proxy wordpress3:80 {
# import proxyheaders
# }
redir /img /img/
handle_path /img/* {
root * /www/img
file_server
}
redir /files /files/
handle_path /files/* {
root * /www/files
file_server
}
redir /vid /vid/
handle_path /vid/* {
root * /www/vid
file_server
}
redir /txt /txt/
handle_path /txt/* {
root * /www/txt
file_server
}
redir /ytdl /ytdl/
handle_path /ytdl/* {
root * /www/ytdl
file_server
}
redir /icons /icons/
handle_path /icons/* {
root * /www/icons
file_server
}
redir /css /css/
handle_path /css/* {
root * /www/css
file_server
}
}
https://nextcloud.dulanic.com {
import main
header {
Strict-Transport-Security "max-age=63072000; includeSubDomains; preload"
Content-Security-Policy "upgrade-insecure-requests"
Referrer-Policy "strict-origin-when-cross-origin"
}
reverse_proxy https://nextcloud:443 {
transport http {
tls
tls_insecure_skip_verify
}
import proxyheaders
}
}
https:// {
import main
import headers
}
https://*.dulanic.com {
import main
import headers
@adguard host adguard.dulanic.com
@autobrr host aut brr.dulanic.com
@bw host thisismysecretbitwarden.dulanic.com
@cgpt host gpt.dulanic.com
@code host code.dulanic.com
@calibre host calibre.dulanic.com
@collabora host collabora.dulanic.com
@webtop host webtop.dulanic.com
@deemix host deemix.dulanic.com
@derbynet host derby.dulanic.com
@dmarc host dmarc.dulanic.com
@dl host dl.dulanic.com
@fb host fb.dulanic.com
@fireshare host fireshare.dulanic.com
@epic host epic.dulanic.com
@grafana host grafana.dulanic.com
@heimdall host heimdall.dulanic.com
@home host home.dulanic.com
@homeassistant host homeassistant.dulanic.com
@irc host irc.dulanic.com
@jellyfin host jellyfin.dulanic.com
@library host library.dulanic.com
@lidarr host lidarr.dulanic.com
@mongo host mongo.dulanic.com
@nextcloud host nextcloud.dulanic.com
@nzbget host nzbget.dulanic.com
@organizr host organizr.dulanic.com
@overseerr host overseerr.dulanic.com
@paperless host paperless.dulanic.com
@pgadmin host pgadmin.dulanic.com
@pghero host pghero.dulanic.com
@phpmyadmin host phpmyadmin.dulanic.com
@photos host photos.dulanic.com
@plex host plex.dulanic.com
@portainer host portainer.dulanic.com
@prowlarr host prowlarr.dulanic.com
@qbittorrent host qbittorrent.dulanic.com
@radarr host radarr.dulanic.com
@radarr4k host radarr4k.dulanic.com
@readarr host readarr.dulanic.com
@recipes host recipes.dulanic.com
@redis host redis.dulanic.com
@rss host rss.dulanic.com
@sonarr host sonarr.dulanic.com
@sync host sync.dulanic.com
@tautulli host tautulli.dulanic.com
@teslacam host teslacam.dulanic.com
@teslamate host teslamate.dulanic.com
@webmin host webmin.dulanic.com
@wiki host wiki.dulanic.com
@ytdl host ytdl.dulanic.com
handle @adguard {
reverse_proxy http://192.168.2.225 {
import proxyheaders
}
}
handle @autobrr {
reverse_proxy http://192.168.2.155:7474 {
import proxyheaders
}
}
handle @bw {
reverse_proxy /notifications/hub/negotiate http://bitwarden:80 {
import proxyheaders
}
reverse_proxy /notifications/hub http://bitwarden:3012 {
import proxyheaders
}
reverse_proxy http://bitwarden:80 {
import proxyheaders
}
}
handle @cgpt {
reverse_proxy http://192.168.2.155:8501 {
import proxyheaders
}
}
handle @code {
reverse_proxy http://vscode:3000 {
import proxyheaders
}
}
handle @collabora {
reverse_proxy http://collabora:9980 {
import proxyheaders
}
}
handle @webtop {
reverse_proxy http://192.168.2.155:3000 {
import proxyheaders
}
}
handle @deemix {
reverse_proxy http://deemix:6595 {
import proxyheaders
}
}
handle @derbynet {
reverse_proxy http://derbynet:80 {
import proxyheaders
}
}
handle @dmarc {
reverse_proxy http://dmarc-report {
import proxyheaders
}
}
handle @dl {
reverse_proxy http://jdownloader:5800 {
import proxyheaders
}
}
handle @fb {
reverse_proxy http://filebrowser {
import proxyheaders
}
}
handle @epic {
reverse_proxy http://epic:3000 {
import proxyheaders
}
}
handle @fireshare {
reverse_proxy http://fireshare {
import proxyheaders
}
}
handle @grafana {
reverse_proxy http://grafana:3000 {
import proxyheaders
}
}
handle @heimdall {
reverse_proxy http://heimdall {
import proxyheaders
}
}
handle @home {
reverse_proxy http://homepage:3000 {
import proxyheaders
}
}
handle @jellyfin {
reverse_proxy jellyfin:8096 {
import proxyheaders
}
}
handle @calibre {
reverse_proxy http://calibre-web:8083 {
import proxyheaders
}
}
handle @nextcloud {
redir /.well-known/carddav /remote.php/dav 301
redir /.well-known/caldav /remote.php/dav 301
reverse_proxy https://nextcloud:443 {
import proxyheaders
transport http {
tls
tls_insecure_skip_verify
}
}
}
handle @rss {
reverse_proxy http://freshrss {
import proxyheaders
}
}
handle @sync {
reverse_proxy http://syncthing:8384 {
import proxyheaders
}
}
handle @teslacam {
reverse_proxy http://teslacamviewer {
import proxyheaders
}
}
handle @redis {
reverse_proxy http://redis-commander:8081 {
import proxyheaders
}
}
handle @ytdl {
redir https://www.youtube.com/watch?v=crbFmpezO4A
}
handle @lidarr {
replace stream {
"</head>" "<link rel='stylesheet' type='text/css' href='https://theme-park.dev/css/base/lidarr/organizr.css'></head>"
}
reverse_proxy http://lidarr:8686 {
import proxyheaders
}
}
handle @nzbget {
reverse_proxy http://nzbget:6789 {
import proxyheaders
}
}
handle @wiki {
reverse_proxy http://wiki:3000 {
import proxyheaders
}
}
handle @webmin {
reverse_proxy http://192.168.2.155:10000 {
import proxyheaders
}
}
handle @prowlarr {
reverse_proxy prowlarr:9696 {
import proxyheaders
}
}
handle @readarr {
reverse_proxy readarr:8787 {
import proxyheaders
}
}
handle @radarr4k {
reverse_proxy radarr4K:7878 {
import proxyheaders
}
}
handle @qbittorrent {
header {
proxy_hide_header "x-webkit-csp";
proxy_hide_header "content-security-policy";
proxy_hide_header "X-Frame-Options";
}
replace stream {
"</head>" "<link rel='stylesheet' type='text/css' href='https://theme-park.dev/css/base/qbittorrent/organizr.css'></head>"
}
reverse_proxy wireguard:8089 {
import proxyheaders
}
}
handle @teslamate {
replace stream {
"</head>" "<link rel='stylesheet' type='text/css' href='https://dulanic.com/css/teslamate.css'></head>"
}
reverse_proxy teslamate:4000 {
import proxyheaders
}
}
handle @tautulli {
reverse_proxy tautulli:8181 {
import proxyheaders
}
}
handle @radarr {
reverse_proxy radarr:7878 {
import proxyheaders
}
}
handle @recipes {
handle_path /media/* {
root * /media
file_server
}
reverse_proxy recipes:8080 {
import proxyheaders
}
}
handle @portainer {
reverse_proxy http://192.168.2.155:9001 {
import proxyheaders
}
}
handle @sonarr {
reverse_proxy sonarr:8989 {
import proxyheaders
}
}
handle @plex {
redir /web /web/
reverse_proxy http://192.168.2.155:32400 {
import proxyheaders
}
}
handle @phpmyadmin {
reverse_proxy phpmyadmin:80 {
import proxyheaders
}
}
handle @pghero {
reverse_proxy pghero:8080 {
import proxyheaders
}
}
handle @pgadmin {
reverse_proxy pgadmin:5050 {
import proxyheaders
}
}
handle @mongo {
reverse_proxy mongoclient:3000 {
import proxyheaders
}
}
handle @organizr {
reverse_proxy organizr:80 {
import proxyheaders
}
}
handle @paperless {
# replace stream {
# "</head>" "<link rel='stylesheet' type='text/css' href='https://theme-park.dev/css/base/portainer/organizr.css'></head>"
# }
reverse_proxy paperless:8000 {
import proxyheaders
}
}
handle @homeassistant {
reverse_proxy http://192.168.2.155:8123 {
import proxyheaders
}
}
handle @irc {
reverse_proxy thelounge:9000 {
import proxyheaders
}
}
handle @overseerr {
reverse_proxy overseerr:5055 {
import proxyheaders
}
}
handle @photos {
reverse_proxy photoprism:2342 {
import proxyheaders
}
}
handle {
redir https://www.youtube.com/watch?v=crbFmpezO4A 302
}