feat: 按历史痕迹恢复 nginx 同域入口

This commit is contained in:
Cheng Zhou
2026-03-31 09:16:41 +08:00
parent ada3beca8e
commit 9535fece6c
8 changed files with 122 additions and 30 deletions
@@ -103,8 +103,8 @@ Expected: PASS
**Step 3: Check HTTP endpoints**
Run: `curl -i http://127.0.0.1:4173/`
Run: `curl -i http://127.0.0.1/`
Expected: `200 OK` and HTML payload
Run: `curl -i http://127.0.0.1:8000/health`
Run: `curl -i http://127.0.0.1/health`
Expected: successful backend health response
@@ -0,0 +1,19 @@
# Restore In-Repo Nginx Design
**Goal:** Restore the repository-managed Nginx entrypoint on `dev` by writing back the earlier removal diff, so frontend static hosting and backend API proxying return to a single same-origin entry.
**Decisions**
- Restore `nginx/nginx.conf` and `nginx/Dockerfile` from the pre-removal topology.
- Replace the `frontend` runtime service in `docker-compose.yaml` with an `nginx` service that serves the built SPA and proxies `/api` and `/health` to `backend`.
- Remove the Caddy-specific runtime file because the repository will no longer use a separate frontend web server.
- Keep later non-nginx fixes that remain valid, especially the frontend API base URL fallback logic for optional local direct access.
**Architecture**
- `db` remains unchanged.
- `backend` remains unchanged and is reachable internally on `backend:8000`.
- `nginx` becomes the public entrypoint again, serving the frontend bundle and reverse proxying API traffic to `backend`.
- The browser returns to same-origin access through the Nginx entrypoint.
**Operational Notes**
- This is an in-place restoration based on the previous removal footprint, not a fresh redesign.
- The current Tencent Cloud/private registry removal remains intact and is not being reintroduced.