Skip to content

fix(website): serve sitemap.xml and robots.txt from Next.js - #15

Merged
vsilent merged 1 commit into
mainfrom
fix/website-sitemap
Oct 31, 2026
Merged

vsilent merged 1 commit into
mainfrom
fix/website-sitemap

Conversation

@vsilent

@vsilent vsilent commented Oct 31, 2026

Copy link
Copy Markdown

Problem

https://stackdog.app/sitemap.xml returns 404, so search engines don't find /php-shell-detection or /php-shell-quickstart through the sitemap.

website/nginx.conf sent /sitemap.xml and /robots.txt to root /app/public, but public/ only holds stackdog-mark.png. Next.js generates both files from app/sitemap.ts and app/robots.ts, and nginx never passed those requests to it.

Live /robots.txt is currently only Cloudflare's managed content (# BEGIN Cloudflare Managed content), without the app's Sitemap: line.

Fix

robots.txt and sitemap.xml are removed from the static-file location regex, so both reach the Next.js proxy. A one-line change, plus a comment.

Verification

I built the website image locally (docker build --build-arg SITE_URL=https://stackdog.app) and ran it:

  • /sitemap.xml: 200 application/xml, listing /, /docs, /php-shell-detection, /php-shell-quickstart, /contact under https://stackdog.app
  • /robots.txt: 200, includes Sitemap: https://stackdog.app/sitemap.xml
  • /stackdog-mark.png and /php-shell-quickstart: 200, unchanged

After deploy

Check https://stackdog.app/robots.txt. Guess: Cloudflare's managed robots.txt merges with the origin's rather than replacing it. Not verified.

🤖 Generated with Claude Code

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 <noreply@anthropic.com>
@vsilent
vsilent merged commit 1c915de into main Oct 31, 2026
8 checks 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.

2 participants