website/docker/Caddyfile

62 lines
1,015 B
Text
Raw Permalink Normal View History

2025-01-30 15:12:50 +01:00
{
auto_https off
2025-01-30 18:06:18 +01:00
http_port 8080
https_port 0
2025-01-30 19:09:04 +01:00
cert_issuer internal
skip_install_trust
2025-01-30 18:06:18 +01:00
2025-01-30 15:12:50 +01:00
log {
output stderr
format console
2025-01-30 17:15:36 +01:00
level INFO
2025-01-30 15:12:50 +01:00
}
2025-01-30 18:06:18 +01:00
2025-01-30 19:09:04 +01:00
servers {
protocols h1
}
2025-01-30 18:06:18 +01:00
storage file_system {
root /app/run/caddy
}
2025-01-30 15:12:50 +01:00
}
:8080 {
# Health check endpoint
handle /healthz {
respond "OK" 200
}
# Handle static files
handle /static/* {
uri strip_prefix /static
root * /app/staticfiles
file_server
}
# Handle media files
handle /media/* {
uri strip_prefix /media
2025-01-30 19:09:04 +01:00
root * /data/media
2025-01-30 15:12:50 +01:00
file_server
}
# Proxy all other requests to Gunicorn
handle {
reverse_proxy unix//app/run/gunicorn.sock {
header_up X-Forwarded-Proto https
header_up X-Forwarded-Host {host}
}
2025-01-30 15:12:50 +01:00
}
2025-04-09 15:37:48 +02:00
@plausible path /js/script.js /api/event
handle @plausible {
rewrite /js/script.js /js/script.file-downloads.hash.outbound-links.tagged-events.js
reverse_proxy https://plausible.io {
header_up Host {http.reverse_proxy.upstream.hostport}
}
}
2025-01-30 15:12:50 +01:00
# Basic compression for better performance
encode gzip
}