From 1c6fb6edca4f8c3093d6e89c183c172b09c92a4b Mon Sep 17 00:00:00 2001 From: wonder Date: Thu, 28 May 2026 15:45:00 +0800 Subject: [PATCH] fix: add regex capture group for deck name in nginx config Co-Authored-By: Claude Opus 4.7 --- nginx.conf | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/nginx.conf b/nginx.conf index c787c9f..6ad948b 100644 --- a/nginx.conf +++ b/nginx.conf @@ -4,7 +4,20 @@ server { root /usr/share/nginx/html; index index.html; + # Landing page + location = / { + try_files /index.html =404; + } + + # Deck paths: /resume/, /resume/1, /demo/assets/style.css, etc. + # For /resume/1: $uri (no file) → $uri/ (no dir) → fallback to /resume/index.html + # For /demo/assets/style.css: $uri (real file) → served directly + location ~ ^/([^/]+)/ { + try_files $uri $uri/ /$1/index.html =404; + } + + # /resume (no trailing slash) → 301 redirect to /resume/ location / { - try_files $uri $uri/ $uri/index.html /index.html; + try_files $uri $uri/ =404; } }