fix: block LLM/search crawlers on branch deploy subdomains#2122
Open
fix: block LLM/search crawlers on branch deploy subdomains#2122
Conversation
✅ Deploy Preview for pomerium-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
2 tasks
Contributor
Author
|
Updated this to be branch-aware instead of a manual-revert hack.
So when we cut |
Add robots.txt to main branch that disallows all crawlers. Branch deploys (e.g., main.docs.pomerium.com) were returning 404 for robots.txt, allowing LLM scrapers to freely index stale content. Production (0-32-0 branch) is unaffected — it has its own permissive robots.txt. Fixes ENG-3768
62879b0 to
5e69bc9
Compare
nickytonline
approved these changes
Mar 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
robots.txtbranch-aware instead of relying on a manual revert when the next release branch is cutrobots.txtfor numbered release branches like0-33-0Problem
*.docs.pomerium.comwildcard DNS routes branch deploys through Netlify, so branch builds are publicly fetchable unless we actively block crawlers.The first draft of this change hard-coded
static/robots.txttoDisallow: /onmain, which would have required a manual undo when the next stable release branch is cut. That is exactly the kind of thing we forget.Approach
This PR keeps the checked-in fallback safe (
Disallow: /) and adds a small Docusaurus post-build plugin that writes the allow template only when the build is for a numbered release branch.Behavior:
deploy-preview/branch-deployonmainor any other non-release branch:Disallow: /0-33-0: write the normal permissiverobots.txtPOMERIUM_DOCS_ROBOTS_MODE=allow|disallowThis means we do not need to remember a revert when we cut
0-33-0; the release branch will emit the right file automatically.Verification
Verified locally with full builds:
HEAD=main BRANCH=main CONTEXT=branch-deploy yarn build->build/robots.txtisDisallow: /HEAD=0-33-0 BRANCH=0-33-0 CONTEXT=branch-deploy yarn build->build/robots.txtis the normal allow templateFixes ENG-3768