From 13bf6b4aeed1b480d8c5e7c0d13cb676ed25d79f Mon Sep 17 00:00:00 2001 From: Ngoni Mandiveyi Date: Sat, 23 May 2026 21:54:20 -0400 Subject: [PATCH] fix: do url --- infra/README.md | 3 ++- infra/modules/frontend/main.tf | 28 ++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/infra/README.md b/infra/README.md index ea0610c..bdce3ff 100644 --- a/infra/README.md +++ b/infra/README.md @@ -133,5 +133,6 @@ export TF_VAR_cloudflare_account_id="..." ## Domain - **Apex:** `nmandiveyi.com` (PRIMARY) -- **WWW:** `www.nmandiveyi.com` (ALIAS) +- **WWW:** `www.nmandiveyi.com` (ALIAS, canonical) - **Deploy branch:** `main` (App Platform `deploy_on_push`, Next.js on port 3001) +- **Starter URL:** DigitalOcean always assigns `*.ondigitalocean.app`; it cannot be deleted. Ingress redirects it with **301 → `www.nmandiveyi.com`** after `terraform apply`. diff --git a/infra/modules/frontend/main.tf b/infra/modules/frontend/main.tf index a15e407..62895a3 100644 --- a/infra/modules/frontend/main.tf +++ b/infra/modules/frontend/main.tf @@ -39,5 +39,33 @@ resource "digitalocean_app" "this" { type = "ALIAS" zone = var.manage_dns_zone ? var.domain : null } + + ingress { + rule { + component { + name = "web" + } + + match { + path { + prefix = "/" + } + } + } + + rule { + redirect { + authority = var.www_domain + scheme = "https" + redirect_code = 301 + } + + match { + authority { + exact = "$${STARTER_DOMAIN}" + } + } + } + } } }