Fix sitemap.xml 404: correct nginx-unprivileged port 80 → 8080, set www canonical URLs, and fix site deployment target#429
Conversation
|
@copilot this is the url id expect it to be athttps://www.cloudhealthoffice.com/sitemap.xml |
Co-authored-by: aurelianware <194855645+aurelianware@users.noreply.github.com>
…ots.txt Co-authored-by: aurelianware <194855645+aurelianware@users.noreply.github.com>
Done in d5b7f03. Both |
|
@copilot I think the app is running in a container app environment t, not in the kubernetes closter |
There was a problem hiding this comment.
Pull request overview
Fixes marketing site availability issues caused by a port mismatch (nginx-unprivileged listens on 8080) and updates SEO crawl hints to use www.cloudhealthoffice.com as the canonical domain.
Changes:
- Update Kubernetes site Deployment/Service/probes to use container port 8080 (service still exposed on 80).
- Update Azure Container Apps deploy workflow to set ingress
--target-port 8080. - Switch sitemap/robots canonical URLs to
https://www.cloudhealthoffice.com/....
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
infra/k8s/site-deployment.yaml |
Changes site container/probe/Service target port mapping to 8080. |
.github/workflows/deploy-azure-aks.yml |
Updates ACA ingress target port to 8080 during site deploy. |
src/site/sitemap.xml |
Updates <loc> URLs to use www canonical domain. |
src/site/robots.txt |
Updates Sitemap: directive to point to the www sitemap URL. |
| az containerapp ingress update \ | ||
| --name "${{ env.ACA_SITE_NAME }}" \ | ||
| --resource-group "${{ env.RESOURCE_GROUP }}" \ | ||
| --target-port 8080 || \ | ||
| echo "::warning::Could not update Container App ingress target port – ensure it is set to 8080 (nginx-unprivileged listens on 8080)" | ||
|
|
There was a problem hiding this comment.
This || echo "::warning::..." makes the step succeed even if the ingress target port update fails, which can leave the Container App serving 404s while the workflow reports a successful deploy. Consider failing the job when the port cannot be set (or at least querying the current ingress target port and only continuing if it’s already 8080).
| az containerapp ingress update \ | |
| --name "${{ env.ACA_SITE_NAME }}" \ | |
| --resource-group "${{ env.RESOURCE_GROUP }}" \ | |
| --target-port 8080 || \ | |
| echo "::warning::Could not update Container App ingress target port – ensure it is set to 8080 (nginx-unprivileged listens on 8080)" | |
| CURRENT_PORT=$(az containerapp show \ | |
| --name "${{ env.ACA_SITE_NAME }}" \ | |
| --resource-group "${{ env.RESOURCE_GROUP }}" \ | |
| --query "properties.configuration.ingress.targetPort" -o tsv || echo "") | |
| if [ "$CURRENT_PORT" = "8080" ]; then | |
| echo "Ingress target port is already 8080; no update required." | |
| else | |
| echo "Ingress target port is '${CURRENT_PORT:-unknown}', updating to 8080..." | |
| az containerapp ingress update \ | |
| --name "${{ env.ACA_SITE_NAME }}" \ | |
| --resource-group "${{ env.RESOURCE_GROUP }}" \ | |
| --target-port 8080 | |
| fi |
There was a problem hiding this comment.
Are changes to kubernetes deployment still needed since it’s ACA?
There was a problem hiding this comment.
No, the K8s site manifest is no longer applied in production — the deploy-aks job's site deployment steps were removed in a46bf77 since the site runs exclusively in Container Apps. The file stays in the repo with the correct port as reference, but it has no effect on the live deployment.
| image: REGISTRY_PLACEHOLDER/cloudhealthoffice-site:latest | ||
| ports: | ||
| - containerPort: 80 | ||
| - containerPort: 8080 |
There was a problem hiding this comment.
ports: is not indented as a list here. As written, - containerPort: 8080 is at the same indentation level as ports:, which makes the Pod spec invalid YAML for Kubernetes and will cause the Deployment apply to fail. Indent the list item under ports: (and keep consistent indentation for any additional ports).
| - containerPort: 8080 | |
| - containerPort: 8080 |
…ner Apps, not AKS) Co-authored-by: aurelianware <194855645+aurelianware@users.noreply.github.com>
Fixed in a46bf77. The |
|
@copilot apply changes based on the comments in this thread |
…il properly if update needed Co-authored-by: aurelianware <194855645+aurelianware@users.noreply.github.com>
Applied in 476fa4f. The ingress step now queries the current |
nginx-unprivileged:alpinebinds on 8080, not 80.infra/k8s/site-deployment.yamlhad port 80 hardcoded throughout, causing liveness/readiness probes to fail, pods to never become Ready, and the NGINX ingress to return 404 for all traffic tocloudhealthoffice.com— including/sitemap.xml.Additionally, the sitemap and robots.txt were updated to use
www.cloudhealthoffice.comas the canonical domain, so the sitemap is correctly referenced athttps://www.cloudhealthoffice.com/sitemap.xml.The marketing site runs in Azure Container Apps, not the Kubernetes cluster. The
deploy-aksjob was incorrectly applying the site Kubernetes manifests to AKS; those steps have been removed so AKS exclusively manages the portal and backend services.Changes
infra/k8s/site-deployment.yaml—containerPort, liveness/readiness probe ports, and servicetargetPortall changed 80 → 8080 (kept as reference; no longer applied to production)deploy-azure-aks.yml(deploy-sitejob) — split into two steps: image update and a dedicatedEnsure ingress target port is 8080step that queries the current port first, skips the update if already correct, and fails the job properly if the update is needed but fails (replaces the previous silent::warning::fallback)deploy-azure-aks.yml(deploy-aksjob) — removed the "Substitute ACR image in site deployment" and "Apply site ingress" steps; the site is exclusively deployed via thedeploy-siteContainer Apps jobsrc/site/sitemap.xml— all<loc>entries updated to usehttps://www.cloudhealthoffice.com/as the canonical base URLsrc/site/robots.txt—Sitemap:directive updated tohttps://www.cloudhealthoffice.com/sitemap.xmlOriginal prompt
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.