From 7fcc1085c1e5660644f8513eef138420df7931e1 Mon Sep 17 00:00:00 2001 From: Tim Trautmann Date: Fri, 29 May 2026 12:17:09 -0700 Subject: [PATCH] Setup: include Caddy + nginx snippets for the .well-known file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The wizard's '① .well-known file' section now prints ready-to-paste reverse-proxy snippets with the operator's actual AT-URI substituted in — Caddy (covers the bundled-Caddy pattern in the official Ghost docker compose) and nginx (covers Ghost-CLI's default and most custom setups). Plus a reload reminder. Cuts the 'figure out your reverse proxy's syntax' step out of the loop for the most common deployments. Operators on more exotic setups (Cloudflare Workers, Traefik, etc.) still have to translate the intent themselves, but the pattern is the same: serve the AT-URI as text/plain at the exact path, before any catch-all proxy directive. --- src/commands/site.ts | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/commands/site.ts b/src/commands/site.ts index 3201010..383ba09 100644 --- a/src/commands/site.ts +++ b/src/commands/site.ts @@ -338,9 +338,25 @@ export async function runSiteAddInteractive(): Promise { // 10. Next steps console.log('\n' + pc.green('✓ ') + pc.bold(`Site "${slug}" ready.`) + '\n'); + const atUri = updatedSite.publication_at_uri ?? ''; console.log(pc.bold(pc.cyan(' ① .well-known file'))); console.log(pc.dim(` Serve this exact content at ${pc.bold(wellKnownPath)} :\n`)); - console.log(' ' + pc.green(updatedSite.publication_at_uri ?? '')); + console.log(' ' + pc.green(atUri)); + console.log(pc.dim('\n Drop one of these into the reverse proxy that fronts Ghost, before')); + console.log(pc.dim(' any catch-all directive that proxies to the Ghost container:\n')); + console.log(pc.dim(' Caddy (e.g. the bundled Caddy in the official Ghost docker-compose):')); + console.log(pc.dim(' ') + pc.cyan('handle /.well-known/site.standard.publication {')); + console.log(pc.dim(' ') + pc.cyan('header Content-Type text/plain')); + console.log(pc.dim(' ') + pc.cyan(`respond "${atUri}"`)); + console.log(pc.dim(' ') + pc.cyan('}')); + console.log(''); + console.log(pc.dim(' nginx:')); + console.log(pc.dim(' ') + pc.cyan('location = /.well-known/site.standard.publication {')); + console.log(pc.dim(' ') + pc.cyan('default_type text/plain;')); + console.log(pc.dim(' ') + pc.cyan(`return 200 "${atUri}";`)); + console.log(pc.dim(' ') + pc.cyan('}')); + console.log(pc.dim('\n Reload after editing — `docker compose exec caddy caddy reload`')); + console.log(pc.dim(' for bundled Caddy, `sudo nginx -s reload` (or systemctl) for nginx.')); console.log(''); if (!webhooksAuto) { -- 2.51.2