repos
/ status-django master

status-django

mirror archived upstream

Self-hostable uptime monitor and status page on Django: HTTP checks, Lighthouse audits, SEO crawls, and email and Discord alerts.

djangodockerhandcodedpythonself-hostedsqlitestatus-pageuptime-monitoringvite

933 B · 49 lines · Caddyfile Raw History
 1# Caddyfile for status
 2#
 3# I like to use Caddy Server for simple reverse proxies since it has built in
 4# automatic HTTPS support. It is probably worth serving static files with
 5# Caddy too but I've honestly been too lazy to implement that. I just use
 6# whitenoise on Django for that.
 7{
 8  servers {
 9    protocol {
10      experimental_http3
11    }
12  }
13}
14
15(common) {
16  header /static/* {
17    Cache-Control "public, max-age=315360000"
18  }
19
20  header /media/* {
21    Cache-Control "public, max-age=315360000"
22  }
23
24  header /* {
25    Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
26    X-XSS-Protection "1; mode=block"
27    X-Frame-Options DENY
28    X-Content-Type-Options nosniff
29    -Server
30    -X-Powered-By
31  }
32
33  encode zstd gzip
34}
35
36status.example.com {
37  handle /media/* {
38    uri strip_prefix /media
39    file_server {
40      root /srv/data/status/media
41    }
42  }
43
44  reverse_proxy localhost:8000
45
46  import common
47}