- Dockerfile: nginx:1.27-alpine, copies static files + nginx.conf - nginx.conf: gzip, long cache for images, short cache for HTML/JS, SPA fallback to index.html (hash router handles /#/projects/<slug>) - docker-compose.yml: restart unless-stopped, healthcheck on :43036 - README: docker compose up -d --build Keeps port 43036 so the existing nginx-proxy-manager route for wilddragon.net (-> :43036) keeps working without reconfig.
38 lines
1.1 KiB
Nginx Configuration File
38 lines
1.1 KiB
Nginx Configuration File
server {
|
|
listen 43036 default_server;
|
|
listen [::]:43036 default_server;
|
|
server_name _;
|
|
|
|
root /usr/share/nginx/html;
|
|
index index.html;
|
|
|
|
charset utf-8;
|
|
|
|
gzip on;
|
|
gzip_types text/plain text/css text/javascript application/javascript application/json image/svg+xml;
|
|
gzip_min_length 1024;
|
|
|
|
# Long cache for static assets — they're content-addressed by path,
|
|
# bust via filename when they change.
|
|
location ~* \.(png|jpg|jpeg|gif|webp|svg|ico|woff2?|ttf)$ {
|
|
expires 30d;
|
|
add_header Cache-Control "public, immutable";
|
|
}
|
|
|
|
# Short cache for the HTML/JS that drive the SPA so edits show up fast.
|
|
location ~* \.(html|css|js|jsx)$ {
|
|
expires 5m;
|
|
add_header Cache-Control "public, must-revalidate";
|
|
}
|
|
|
|
# Single-page app — unknown paths fall back to index.html, which
|
|
# handles routing via location.hash (#/projects/<slug>).
|
|
location / {
|
|
try_files $uri $uri/ /index.html;
|
|
}
|
|
|
|
# llms.txt — let crawlers pull it without rewrites.
|
|
location = /llms.txt {
|
|
default_type text/plain;
|
|
}
|
|
}
|