Files
2026-03-27 22:00:19 +08:00

39 lines
597 B
Bash

#!/bin/sh
set -e
echo "Starting Caddy with backend URL: ${BACKEND_URL}"
cat << EOF | tee /etc/caddy/Caddyfile
{
auto_https off
local_certs
skip_install_trust
http_port 3000
}
http:// {
encode gzip zstd
handle_path /api/* {
reverse_proxy ${BACKEND_URL}
}
@assets path /assets/* /favicon.svg
handle @assets {
root * /www
header Cache-Control "public, max-age=31536000, immutable"
file_server
}
handle {
root * /www
try_files {path} /index.html
header Cache-Control "no-store, no-cache, must-revalidate"
file_server
}
}
EOF
caddy run --config /etc/caddy/Caddyfile