fix: add nginx config for Jekyll clean URLs

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 <noreply@anthropic.com>
This commit is contained in:
2025-11-15 15:53:06 +01:00
parent 7e0f1f7459
commit 9739cc749a
2 changed files with 26 additions and 0 deletions

View File

@@ -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

23
nginx.conf Normal file
View File

@@ -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;
}
}