Files
ladill-link/deploy/nginx
isaaccladandClaude 07c2769301
Deploy Ladill Link / deploy (push) Successful in 59s
link: version the ladl.link cache and log rotation
Both were applied by hand during an incident and existed only in /etc on one
server. server-bootstrap.sh generates the ladl.link vhost, and its version had no
caching at all — so rebuilding the box would have silently restored a ~44 req/s
ceiling on a link being handed to a very large audience, with nothing in git
recording that the cache should exist. Laravel log rotation had the same problem:
none was configured anywhere, and logs had reached 808M across apps.

Now tracked under deploy/ and installed by bootstrap:

  nginx/conf.d/ladill-link-cache.conf        FastCGI cache zone
  nginx/snippets/ladill-link-cached.conf     cached path, 10m
  nginx/snippets/ladill-link-cached-short.conf   same, 60s
  nginx/snippets/ladill-link-public-cache.conf   which routes are cached
  nginx/snippets/ladill-link-hot-pages.conf  per-campaign slugs
  logrotate/ladill-laravel

Campaign slugs live in their own snippet so a hot link can be added or retired
with an nginx reload instead of a deploy, and bootstrap seeds that file only when
absent so it is never clobbered.

Caching stays deliberately narrow. ladl.link also serves the admin app, and the
cached path strips Set-Cookie, so anything reaching it would lose its session.
Only /q/, */bookshop-* and listed campaign pages are cached; SSO and dashboard
fall through untouched — verified after this change: both still set cookies and
carry no cache header.

Generated vhosts now include the snippet from the start, and an existing vhost is
patched in place (with a timestamped backup) rather than rewritten, since it may
carry local edits. Both paths are idempotent.

Applied to production as part of this change, so the committed config is the
config that is running rather than an untested transcription: page 12ms,
cover 14ms, vanity URL 11ms, all cache HIT.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-25 12:14:14 +00:00
..