From 39fa82b19bdc7b56c8c241b4c7cd9a78559a83b0 Mon Sep 17 00:00:00 2001 From: Vasili Pascal Date: Sat, 31 Oct 2026 21:35:38 +0200 Subject: [PATCH] fix(website): serve sitemap.xml and robots.txt from Next.js nginx routed /sitemap.xml and /robots.txt to /app/public, where neither file exists: Next.js generates both from app/sitemap.ts and app/robots.ts. The sitemap returned 404 on stackdog.app, and robots.txt showed only Cloudflare's managed content, without the Sitemap line. Both now go to the Next.js proxy. Checked against a locally built image: /sitemap.xml returns 200 with all five pages, /robots.txt returns 200 with the Sitemap line, and public assets are unchanged. Co-Authored-By: Claude Opus 5.5 --- website/nginx.conf | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/website/nginx.conf b/website/nginx.conf index 227ab9c..f4db7c9 100644 --- a/website/nginx.conf +++ b/website/nginx.conf @@ -42,8 +42,10 @@ http { access_log off; } - # Public folder assets - location ~* ^/(favicon\.ico|robots\.txt|sitemap\.xml|.*\.(png|jpg|jpeg|gif|webp|svg|ico|woff2?|ttf|otf))$ { + # Public folder assets. robots.txt and sitemap.xml are not files: Next.js + # generates them from app/robots.ts and app/sitemap.ts, so they go to + # the proxy below. + location ~* ^/(favicon\.ico|.*\.(png|jpg|jpeg|gif|webp|svg|ico|woff2?|ttf|otf))$ { root /app/public; expires 7d; add_header Cache-Control "public";