fix: strip /staging prefix in Caddyfile before proxying to staging container #1079
Labels
No labels
action
backlog
blocked
bug-report
cannot-reproduce
in-progress
in-triage
needs-triage
prediction/actioned
prediction/dismissed
prediction/unreviewed
priority
rejected
reproduced
tech-debt
underspecified
vision
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: disinto-admin/disinto#1079
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Goal
Caddyfile routing for
/staging/*currently proxies the full path to the staging container, which serves static files from/srv/sitewithout a/staging/subdir — results in 404. Strip the/stagingprefix before proxying so the static server sees/(or/index.html,/assets/…) instead of/staging/….Evidence
Live probe on 2026-04-20 after
docker compose up -d --build edgeon disinto-dev-box:Caddyfile block (
/home/johba/disinto/docker/Caddyfile, andlib/generators.sh:862):Staging container is a Caddy
file-server --root /srv/site. Forwarding/staging/index.html→ staging:80/staging/index.html, which doesn't exist → 404.The fix
Add
uri strip_prefix /stagingbeforereverse_proxy:This rewrites
/staging/index.html→/index.htmlbefore the proxy call, which the staging file-server resolves correctly.Apply the edit in
lib/generators.sh:862(the generator is canonical source — the trackeddocker/Caddyfilegets overwritten on nextdisinto init). Do not hand-editdocker/Caddyfiledirectly.Acceptance criteria
lib/generators.shemitsuri strip_prefix /staginginside thehandle /staging/*blockdocker/Caddyfile.template(if present) updated to matchcurl http://localhost/staging/returns 200 (the staging index) instead of 404curl http://localhost/staging/assets/foo.css) reach the staging container with the stripped path and return appropriate statustests/test-caddyfile-routing.shand/ortests/smoke-edge-subpath.shassertions pass for the staging path after the fixshellcheckclean onlib/generators.shAffected files
lib/generators.sh— adduri strip_prefix /stagingin the staging handle blocktests/test-caddyfile-routing.sh— update assertion to check for the strip_prefix directive (optional).woodpecker/edge-subpath.yml— no change expected; caddy-validate should accept the new directiveRelated
/forge/*(tracked in separate issue)