TryGhost
OSS
Ghost
Fixed Admin Vite crash from Ghost's own protocol-redirect middleware no ref The url override from the previous commit fixed the browser-facing CSRF/origin login loop, but broke apps/admin's own vite dev server: its bootstrap fetch (resolveGhostSiteUrl in apps/admin/vite-backend-proxy.ts) hits GHOST_URL + ghost/api/admin/site/ directly at http://localhost:2368, bypassing Caddy. Once Ghost's url is HTTPS, its url-redirects middleware (getAdminRedirectUrl) 301s any request it sees as insecure to that HTTPS url -- real browser traffic through Caddy is fine (Caddy sets X-Forwarded-Proto: https, so Express's req.secure is true), but vite's direct fetch has no such header, gets redirected to the public, GitHub-auth-gated tunnel URL, and crashes trying to parse the login page HTML as JSON. That crash cascades: Nx tears down the whole run-many continuous-task group when one task exits non-zero, taking Ember/Portal/shade/etc. down with it -- confirmed via SSH (added sshd specifically to get this kind of ground truth instead of guessing): a live snapshot caught ember as a defunct zombie following this exact crash trace in the frontend log. Fixed by routing GHOST_URL through the gateway container instead (http://ghost-dev-gateway:80/) -- confirmed via direct curl that this returns a clean 200 with the correct site JSON. Stays on the internal Docker network (no GitHub auth wall) while still picking up X-Forwarded-Proto: https from Caddy, so no redirect either.
nx run ghost:test:e2e
Sign in / Sign up
Open main menu
Succeeded
CI Pipeline Execution
nx run ghost:test:e2e
Click to copy
Linux
4 CPU cores
read-write
access token used
7639ef46
29106