This repository has been archived on 2026-09-08. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
UserBaseFront/deploy/fix_caddy.sh
T

16 lines
745 B
Bash

set -u
echo "===== A. Reload caddy from inside the container (reads mounted /etc/caddy/Caddyfile) ====="
docker exec caddy caddy reload --config /etc/caddy/Caddyfile --adapter caddyfile
echo "reload exit: $?"
sleep 2
echo
echo "===== B. Verify running config now contains userbase ====="
docker exec caddy curl -s localhost:2019/config/ | grep -c "userbase"
echo "(count above; 0 means still missing)"
echo
echo "===== C. Test routes via 127.0.0.1 with Host header ====="
for p in /userbase/ /userbase/index.html /userbase/static/js/ /userbase/api/x /userbase/login; do
code=$(curl -s -o /tmp/ub_body -w "%{http_code}" -H "Host: www.yunhaixingtong.com" "http://127.0.0.1$p")
echo "$p -> $code | $(head -c 90 /tmp/ub_body | tr -d '\n')"
done