From 77155d30beacc92fb3fd746455931a90bf9c81df Mon Sep 17 00:00:00 2001 From: Vantz Stockwell Date: Sun, 15 Feb 2026 10:21:11 -0500 Subject: [PATCH] =?UTF-8?q?feat:=20Domain-based=20routing=20=E2=80=94=20ma?= =?UTF-8?q?rketing=20site=20at=20bare=20domain,=20panel=20at=20subdomain?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit corrosionmgmt.com now serves LandingView as the default page with marketing routes at root level. panel.corrosionmgmt.com continues serving the admin panel unchanged. /site/* backward compat via redirects on marketing domain. - nginx: Add bare domain server block (only proxies /api/early-access/) - router: Detect hostname at module load, generate domain-specific routes - MarketingLayout: Named routes for nav, external tags for auth links - LandingView: CTAs point to panel domain via VITE_PANEL_URL Co-Authored-By: Claude Opus 4.6 --- .env.example | 3 + docker/nginx.conf | 22 +++ .../src/components/layout/MarketingLayout.vue | 26 ++-- frontend/src/router/index.ts | 129 +++++++++++++----- frontend/src/views/marketing/LandingView.vue | 11 +- 5 files changed, 137 insertions(+), 54 deletions(-) diff --git a/.env.example b/.env.example index efdf7b3..738916e 100644 --- a/.env.example +++ b/.env.example @@ -39,3 +39,6 @@ SMTP_FROM=noreply@corrosionmgmt.com # Server API_PORT=3000 FRONTEND_URL=http://localhost:5174 + +# Frontend (Vite — must be prefixed with VITE_) +VITE_PANEL_URL=https://panel.corrosionmgmt.com diff --git a/docker/nginx.conf b/docker/nginx.conf index 6c6f19d..18c8895 100644 --- a/docker/nginx.conf +++ b/docker/nginx.conf @@ -67,6 +67,28 @@ http { } } + # Marketing site — corrosionmgmt.com (bare domain) + server { + listen 80; + server_name corrosionmgmt.com; + + # Early access signup API + location /api/early-access/ { + limit_req zone=api burst=10 nodelay; + proxy_pass http://api; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + } + + # SPA + location / { + root /usr/share/nginx/html; + try_files $uri $uri/ /index.html; + } + } + # Wildcard server — *.corrosionmgmt.com (public server sites) server { listen 80; diff --git a/frontend/src/components/layout/MarketingLayout.vue b/frontend/src/components/layout/MarketingLayout.vue index 966c9fb..3f19ec2 100644 --- a/frontend/src/components/layout/MarketingLayout.vue +++ b/frontend/src/components/layout/MarketingLayout.vue @@ -1,5 +1,7 @@