Skip to content

Commit 4a1c89d

Browse files
authored
Fix 404 page routing and cleanup (#14)
1 parent 16d2584 commit 4a1c89d

File tree

2 files changed

+3
-15
lines changed

2 files changed

+3
-15
lines changed

Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,13 @@ RUN pnpm run build
2424
# Final stage - minimal nginx
2525
FROM nginx:alpine
2626

27-
# SPA routing + caching for static assets
27+
# Static site routing + caching for static assets
2828
RUN printf 'server {\n\
2929
listen 80;\n\
3030
root /usr/share/nginx/html;\n\
31+
error_page 404 /404.html;\n\
3132
location / {\n\
32-
try_files $uri $uri/ $uri.html /index.html;\n\
33+
try_files $uri $uri/ $uri.html =404;\n\
3334
}\n\
3435
location ~* \\.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2)$ {\n\
3536
expires 1y;\n\

src/pages/404.astro

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -136,14 +136,6 @@ import '@/styles/custom.css';
136136
user-select: none;
137137
}
138138

139-
.command {
140-
color: oklch(0.9 0.01 106.423);
141-
}
142-
143-
.path {
144-
color: oklch(0.768 0.233 130.85);
145-
}
146-
147139
.error-line {
148140
display: flex;
149141
align-items: baseline;
@@ -284,11 +276,6 @@ import '@/styles/custom.css';
284276
</div>
285277
</div>
286278
<div class="terminal-body">
287-
<div class="line">
288-
<span class="prompt">$ </span>
289-
<span class="command">sprite exec</span>
290-
<span class="path"> {Astro.url.pathname}</span>
291-
</div>
292279
<div class="error-line">
293280
<span class="error-code">404</span>
294281
<span class="error-msg">This sprite escaped its sandbox</span>

0 commit comments

Comments
 (0)