61 lines
1,015 B
Caddyfile
61 lines
1,015 B
Caddyfile
{
|
|
auto_https off
|
|
http_port 8080
|
|
https_port 0
|
|
cert_issuer internal
|
|
skip_install_trust
|
|
|
|
log {
|
|
output stderr
|
|
format console
|
|
level INFO
|
|
}
|
|
|
|
servers {
|
|
protocols h1
|
|
}
|
|
|
|
storage file_system {
|
|
root /app/run/caddy
|
|
}
|
|
}
|
|
|
|
: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
|
|
root * /data/media
|
|
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}
|
|
}
|
|
}
|
|
|
|
@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}
|
|
}
|
|
}
|
|
|
|
# Basic compression for better performance
|
|
encode gzip
|
|
}
|