# --------------------------------------------------------------------------- # Nginx static sitemap file serving # --------------------------------------------------------------------------- # Compatible with the production skinbase.org vhost, which has NO named # location @php. Laravel is already wired as: # # location / { # try_files $uri $uri/ /index.php?$query_string; # } # location = /index.php { # fastcgi_pass unix:/run/php/php8.4-fpm-skinbase.sock; # ... # } # # Do not add `try_files ... @php` — that named location does not exist on # server3 and nginx -t / runtime would fail (or 500) when the static file # is missing. # # GenerateSitemapsCommand writes: # public/sitemaps/index.xml <- canonical generated root index # public/sitemaps/sitemap.xml <- legacy filename (best-effort) # public/sitemap.xml <- legacy $uri (often unwritable on prod) # public/sitemaps/{name}.xml <- child / shard documents # # Place these location blocks BEFORE `location /` is not required if they are # more specific (`=` and regex), but they must remain inside the 443 server. # --------------------------------------------------------------------------- # Root sitemap index location = /sitemap.xml { # Prefer the scheduler-writable generated index. Fall back to the legacy # sitemaps/sitemap.xml, then Laravel front controller (not @php). try_files /sitemaps/index.xml /sitemaps/sitemap.xml /index.php?$query_string; add_header Cache-Control "public, max-age=21600" always; add_header Content-Type "application/xml; charset=UTF-8" always; etag on; } # Per-family / per-shard sitemap documents location ~ ^/sitemaps/[A-Za-z0-9_\-]++\.xml$ { try_files $uri /index.php?$query_string; add_header Cache-Control "public, max-age=21600" always; add_header Content-Type "application/xml; charset=UTF-8" always; etag on; }