Skip to content

FIX [OPS] Stabilize lab-api behind Cloudflare Tunnel (localhost ingress)#9

Merged
AdaInTheLab merged 2 commits into
mainfrom
scms/vesper-admin
Jan 3, 2026
Merged

FIX [OPS] Stabilize lab-api behind Cloudflare Tunnel (localhost ingress)#9
AdaInTheLab merged 2 commits into
mainfrom
scms/vesper-admin

Conversation

@AdaInTheLab
Copy link
Copy Markdown
Owner

🧠 What changed

This PR stabilizes the lab-api backend when served behind a Cloudflare Tunnel by
aligning production behavior with a localhost-only ingress model.

The API is now explicitly designed to be reached via:

Cloudflare → cloudflared tunnel → localhost:8001

…and not via the server’s public IP.


🐛 Problem

Production was intermittently returning 503 / connection refused errors due to
components attempting to reach the API at:

173.236.223.89:8001

That port is intentionally not exposed publicly and is only reachable on
127.0.0.1. Any proxy or rewrite path using the public IP would fail.


✅ Resolution

  • Confirmed API is healthy and stable on localhost:8001
  • Ensured /health and core routes function correctly under tunnel ingress
  • Aligned backend behavior with Cloudflare Tunnel expectations
  • Removed reliance on public-IP access for internal routing

The API is now production-safe when accessed exclusively via:

https://api.thehumanpatternlab.com

🔍 Verification

  • curl http://127.0.0.1:8001/health200 OK
  • curl https://api.thehumanpatternlab.com/health200 OK
  • curl http://<public-ip>:8001expected failure
  • No 503s observed after tunnel alignment

📌 Notes

  • This PR pairs with frontend changes that update VITE_API_BASE_URL
    to the api. subdomain.
  • Any remaining /api usage on the main domain should be handled
    via redirects, not reverse proxies.

🦊 Backend is now correctly tunnel-native and no longer haunted by public IP routing.

AdaInTheLab and others added 2 commits January 2, 2026 09:12
co-authored-by: Lyric <lyric@thehumanpatternlab.com>
co-authored-by: Carmel <carmel@thehumanpatternlab.com>
- Ensure /health and core routes are stable under localhost ingress
- Production hardening for api.thehumanpatternlab.com traffic

co-authored-by: Lyric <lyric@thehumanpatternlab.com>
co-authored-by: Carmel <carmel@thehumanpatternlab.com>"
@AdaInTheLab AdaInTheLab merged commit d28be8c into main Jan 3, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant