From 31d2415b8692530774bdb644d4e7bfcf0872d025 Mon Sep 17 00:00:00 2001 From: tanyar09 Date: Thu, 29 Jan 2026 19:33:17 +0000 Subject: [PATCH] docs: remove issue/symptom/cause sections, keep only configuration steps Simplify reverse proxy documentation to focus on configuration instructions only, removing explanatory issue/symptom/cause sections. --- docs/DEPLOY_FROM_SCRATCH.md | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/docs/DEPLOY_FROM_SCRATCH.md b/docs/DEPLOY_FROM_SCRATCH.md index c3c1f05..5b4d8ea 100644 --- a/docs/DEPLOY_FROM_SCRATCH.md +++ b/docs/DEPLOY_FROM_SCRATCH.md @@ -314,15 +314,7 @@ curl -sS http://127.0.0.1:3001/api/health ## Step 11 — Reverse Proxy Setup (HTTPS via Caddy/nginx) -If you're using a reverse proxy (Caddy, nginx, etc.) to serve the application over HTTPS, you need to configure it to route `/api/*` requests to the backend **before** serving static files. - -### Issue: API requests returning HTML instead of JSON - -**Symptom:** Login works but navigation tabs don't show, or API calls return HTML (the frontend's `index.html`) instead of JSON data. - -**Cause:** The reverse proxy is serving static files for all requests, including `/api/*` requests, instead of forwarding them to the backend. - -### Solution: Configure proxy to route `/api/*` first +If you're using a reverse proxy (Caddy, nginx, etc.) to serve the application over HTTPS, configure it to route `/api/*` requests to the backend **before** serving static files. The proxy must forward `/api/*` requests to the backend (port 8000) **before** trying to serve static files. @@ -409,11 +401,8 @@ This allows the frontend to use relative API paths (`/api/v1/...`) that work cor ## Common fixes -### API requests return HTML instead of JSON (reverse proxy issue) +### API requests return HTML instead of JSON -**Symptom:** Browser console shows API responses are HTML (the frontend's `index.html`) instead of JSON. Login may work but navigation tabs don't appear. - -**Solution:** 1. Ensure your reverse proxy (Caddy/nginx) routes `/api/*` requests to the backend **before** serving static files (see Step 11 above). 2. Verify `admin-frontend/.env` has `VITE_API_URL=` (empty) when using a proxy. 3. Rebuild the frontend after changing `.env`: `cd admin-frontend && npm run build && pm2 restart punimtag-admin`