docs: document the cms.stage.llmdev.mozdit.hu nginx vhost (MITHOME-97 follow-up)
CI Pipeline with Test Management / 🧪 Run Tests & Generate Reports (push) Canceled after 0s
Test Reporting & Gherkin Analysis / 🧪 Run Tests & Generate Reports (push) Canceled after 0s
CI Pipeline with Test Management / 🐳 Docker Integration Tests (push) Canceled after 0s
CI Pipeline with Test Management / 🏗️ Build Docker Image (push) Canceled after 0s
CI Pipeline with Test Management / 📊 Generate Test Summary (push) Canceled after 0s
Test Reporting & Gherkin Analysis / 📊 Analyze Test Coverage (push) Canceled after 0s
Test Reporting & Gherkin Analysis / 🔄 Sync with Linear (push) Canceled after 0s
Test Reporting & Gherkin Analysis / ⚡ Performance Monitoring (push) Canceled after 0s

Server-side nginx config isn't tracked anywhere in this repo, which is
exactly how an orphaned vhost went unnoticed: it used to reverse-proxy
to the old CMS (content-editor.js, port 4001), retired in MITHOME-93.
After that service was stopped/disabled, the vhost silently kept
serving its still-valid TLS cert as nginx's apparent fallback for any
unmatched *.mozdit.hu subdomain — which is what produced a real-looking
(but harmless) Firefox "this site may be impersonating" warning when
the user mistyped a URL.

Repointed the vhost (server-side, not in this repo) to reverse-proxy
/admin, /api/ and /_next/ to the same staging app container Payload
already runs on (127.0.0.1:8081) — same backend as stage.mozdit.hu,
just a friendlier admin-specific URL. Root redirects straight to
/admin; anything else redirects to the canonical stage.mozdit.hu to
avoid serving the public site twice. Reused the existing Let's Encrypt
cert (no new certbot run needed).

This commit only adds docs/nginx-vhosts.md, documenting what's live on
the server and why, since nginx config itself isn't part of this
repo's source of truth.

Verified live: TLS cert now matches cms.stage.llmdev.mozdit.hu (no more
mismatch warning), GET / redirects to /admin (302), GET /admin returns
200 with correctly loaded assets (checked in a real browser, zero
console errors), GET /rolunk redirects to stage.mozdit.hu, GET
/api/health proxies through correctly, and POST /api/users/login with
the real staging admin credentials returns 200 through this domain too.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Do Siki
2026-09-11 23:33:01 +02:00
co-authored by Claude Sonnet 5
parent 00d2b82877
commit 265b656df9
+50
View File
@@ -0,0 +1,50 @@
# nginx vhost-ok (szerveroldali, nincs git-ben verziózva)
> Ez a fájl **dokumentáció, nem forrás** — a tényleges konfiguráció a
> szerveren (`sadmin@llmdev.mozdit.hu`) él, `/etc/nginx/sites-available/`
> alatt, ott kell szerkeszteni és `nginx -t` + `systemctl reload nginx`-szel
> érvényesíteni. Ez a projekt nem tart fenn saját IaC-t/Ansible-t az
> nginx-hez; ez a dokumentum azért létezik, hogy a vhost-ok célja és
> létezése ne csak a szerver `/etc/nginx/`-jében legyen fellelhető (lásd
> MITHOME-97 follow-up: egy elárvult, régi CMS-re mutató vhost tanúsítványa
> okozott zavaró Firefox biztonsági figyelmeztetést, mert semmilyen
> dokumentáció nem jelezte a létezését).
A szerver (`llmdev.mozdit.hu`) **több, egymástól független projektet is
kiszolgál** (pl. `n8n.llmdev.mozdit.hu`, `gradia.hu`, `tippom-stage` stb.) —
ez a dokumentum csak a **websitedev / mozdIT** projekthez tartozó
vhost-okat írja le.
## `stage.mozdit.hu`
A publikus staging weboldal — `docker-compose.staging.yml` `app` service,
`127.0.0.1:8081` felé proxyz. Ez a kanonikus staging URL.
## `cms.stage.llmdev.mozdit.hu`
Kényelmi URL a Payload admin felülethez, **ugyanarra a staging
app-konténerre** proxyzva (`127.0.0.1:8081`) — nem külön szolgáltatás, nem
külön adatbázis.
- `/` → 302 redirect `/admin`-ra
- `/admin`, `/api/`, `/_next/` → proxyzva a staging app-ra
- minden más (publikus oldalak) → 302 redirect `https://stage.mozdit.hu`-ra
(nincs duplikált tartalom a két domain alatt)
TLS: Certbot-kezelt Let's Encrypt tanúsítvány, saját magára a
`cms.stage.llmdev.mozdit.hu` névre kiállítva.
**Történet**: ez a vhost eredetileg a régi, egyedi CMS-nek
(`content-editor.js`, `127.0.0.1:4001`) szólt. Miután a CMS-t leépítettük
(MITHOME-93) és a `mozdit-content-editor.service`-t leállítottuk/letiltottuk,
a vhost egy ideig egy halott backendre mutatott, és tanúsítványa lett az
nginx véletlenszerű fallback-je más, nem konfigurált `*.mozdit.hu`
albdomainekre (pl. elgépelt URL-ekre) — ez okozott egy valódinak tűnő, de
ártalmatlan Firefox "site could be impersonating" figyelmeztetést. A vhost-ot
2026-09-11-én átállítottuk a Payload admin felé (lásd fent).
## Production megfelelő (ha/amikor lesz)
Ha production is élesedik, érdemes ugyanezt a mintát követni: egy
`cms.mozdit.hu` (vagy hasonló) vhost, ugyanazzal a proxy-scope-pal
(`/admin`, `/api/`, `/_next/`), a production app portjára (8080) mutatva.