server { listen 80; server_name _; root /usr/share/nginx/html; index index.html; # Serve text responses as UTF-8. Without this nginx omits the charset and # browsers fall back to a locale guess (Windows-1252 on DE systems), which # turns valid UTF-8 in llms.txt / robots.txt into mojibake (â€", für). charset utf-8; charset_types text/plain text/css text/xml application/javascript application/json image/svg+xml; # AI-discovery files (llms.txt, robots.txt): always served as UTF-8 plain # text, never swallowed by the clean-URL fallback, and readable cross-origin # so any AI crawler or tool can fetch them. location ~* \.txt$ { try_files $uri =404; default_type text/plain; add_header Access-Control-Allow-Origin "*" always; add_header Cache-Control "public, max-age=3600" always; } # Serve clean URLs by trying $uri, then $uri.html location / { try_files $uri $uri.html $uri/ /index.html; } # Cache static assets location ~* \.(png|jpg|jpeg|gif|ico|svg|woff|woff2)$ { expires 30d; add_header Cache-Control "public, immutable"; } # Gzip gzip on; gzip_types text/html text/css text/plain application/javascript application/json image/svg+xml; }