From 9739cc749ad9bfd8d7a9b95c68dd7dcbf0df1866 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Kr=C3=BCger?= Date: Sat, 15 Nov 2025 15:53:06 +0100 Subject: [PATCH] fix: add nginx config for Jekyll clean URLs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Configure nginx to try .html extension for clean URLs like /music/shadow 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- Dockerfile | 3 +++ nginx.conf | 23 +++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 nginx.conf diff --git a/Dockerfile b/Dockerfile index 406f29a..f8a3d53 100644 --- a/Dockerfile +++ b/Dockerfile @@ -27,6 +27,9 @@ RUN bundle exec jekyll build # Production stage FROM nginx:alpine +# Copy custom nginx configuration +COPY nginx.conf /etc/nginx/conf.d/default.conf + # Copy built site from builder COPY --from=builder /app/_site /usr/share/nginx/html diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..a6efdf1 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,23 @@ +server { + listen 80; + server_name _; + root /usr/share/nginx/html; + index index.html index.htm; + + # Jekyll clean URLs - try .html extension + location / { + try_files $uri $uri.html $uri/ =404; + } + + # Handle 404 errors + error_page 404 /404.html; + location = /404.html { + internal; + } + + # Handle server errors + error_page 500 502 503 504 /50x.html; + location = /50x.html { + internal; + } +}