AWS CloudFront & Nginx Blueprint: Eliminate SPA Soft-404s on /llms.txt & /pricing.md
Updated 2026-10-31 · Grounded in 1980 audited B2B SaaS domains (33.9% missing valid /llms.txt) · All guides: /guides/
Enterprise B2B SaaS apps hosted on AWS S3 + CloudFront (with 403/404 -> /index.html SPA routing) or Nginx (try_files $uri /index.html) frequently return HTTP 200 text/html React shells when AI crawlers request /llms.txt or /pricing.md. Bind explicit exact-match location blocks before your SPA fallback:
# Nginx exact-match plain-text & JSON agent routes (place BEFORE try_files $uri /index.html)
location ~ ^/(llms\.txt|llms-full\.txt|pricing\.md|answers\.md|\.well-known/ai\.txt)$ {
root /var/www/aso-public;
default_type "text/plain; charset=utf-8";
add_header X-Robots-Tag "all" always;
add_header Cache-Control "public, max-age=3600" always;
try_files $uri =404;
}
location ~ ^/(ai/(summary|faq|service)\.json|\.well-known/(mcp|openapi)\.json)$ {
root /var/www/aso-public;
default_type "application/json; charset=utf-8";
add_header Access-Control-Allow-Origin "*" always;
try_files $uri =404;
}