Files
trailbase/docs/nginx.conf
Sebastian Jeltsch bdb3735840 Squash all commits for a fresh start.
This is only to avoid accidentally leaking any secrets from early development especially in the light of short-sha attacks.
2024-10-30 23:38:56 +01:00

33 lines
1.0 KiB
Nginx Configuration File

server {
# TLS termination is done by the reverse proxy.
listen 80;
listen [::]:80;
server_name trailbase_documentation;
#access_log /var/log/nginx/host.access.log main;
# File root matching build target location in Dockerfile.
root /usr/share/nginx/html;
# 404 and 500s should load our custom error pages.
error_page 404 /404.html;
# error_page 500 502 503 504 /50x/index.html;
location / {
# Set long client-side cache TTLs for astro assets. Astro assets carry a
# content hash in their filename, thus can be cached safely for ever.
location /_astro/ {
add_header Cache-Control "public, max-age=31536000, immutable";
}
location /particles/ {
add_header Cache-Control "public, max-age=2592000, immutable";
}
# Try resolve $uri in the following order:
# * try $uri first
# * then $uri/index.html
# * finally fall back to 404 error_page below.
try_files $uri $uri/index.html =404;
}
}