diff --git a/deploy/Dockerfile b/deploy/Dockerfile index 059d5d9a..8b600be9 100644 --- a/deploy/Dockerfile +++ b/deploy/Dockerfile @@ -4,8 +4,8 @@ ARG GIT_SHA=dev WORKDIR /src COPY scripts/build-site.mjs scripts/ COPY site site -# _headers is for Cloudflare Workers; nginx.conf sends the same headers. -RUN node scripts/build-site.mjs && rm dist/_headers && echo "$GIT_SHA" > dist/version.txt +# _headers and _redirects are for Cloudflare Workers; nginx.conf does the same. +RUN node scripts/build-site.mjs && rm dist/_headers dist/_redirects && echo "$GIT_SHA" > dist/version.txt FROM nginxinc/nginx-unprivileged:1.28-alpine COPY deploy/nginx.conf /etc/nginx/conf.d/default.conf diff --git a/deploy/nginx.conf b/deploy/nginx.conf index 59d0e1a6..e35c790b 100644 --- a/deploy/nginx.conf +++ b/deploy/nginx.conf @@ -28,6 +28,9 @@ server { location = /booking/404.html { internal; } location = /404.html { internal; } + # Planner's landing page is exactly /planner; the trailing-slash form redirects to it. + location = /planner/ { return 301 /planner; } + location / { try_files $uri $uri/index.html $uri/ =404; } error_page 404 /404.html; } diff --git a/scripts/build-site.mjs b/scripts/build-site.mjs index 324aa40b..6d4b3ebc 100755 --- a/scripts/build-site.mjs +++ b/scripts/build-site.mjs @@ -178,10 +178,13 @@ function nav(current) { `
${a.line}
` + `