-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathCaddyfile
53 lines (42 loc) · 949 Bytes
/
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
{$DOMAIN_NAME} {
# HTTPS Options
tls {$TLS_EMAIL}
# Test HTTPS setup
# tls {$TLS_EMAIL} {
# ca https://acme-staging-v02.api.letsencrypt.org/directory
# }
# Removing some headers for improved security:
header -Server
@noRedirect {
not path /maintenance.html
not path /offline.png
}
@maintenanceModeActive file {
root /srv
try_files maintenance.on
}
handle @maintenanceModeActive {
root * /srv
redir @noRedirect /maintenance.html
file_server {
status 503
}
}
# Serves static files, should be the same as `STATIC_ROOT` setting:
root * /var/www/django
file_server
@noStatic {
not path /static/*
not path /media/*
}
# Serving dynamic requests:
reverse_proxy @noStatic django:8000
# Allows to use `.gz` files when available:
encode gzip
# Logs, will keep 5 GB
log {
output file /var/log/caddyaccess.log {
roll_size 5000MiB
}
}
}