Skip to content

Commit

Permalink
Merge pull request #79 from internetstandards/routing
Browse files Browse the repository at this point in the history
Fix frontend internal webserver for routing non-# urls
  • Loading branch information
stitch authored Dec 11, 2024
2 parents 1a2a9e5 + adaa600 commit 16fdb92
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ RUN make build-gui-deploy
# Copy all compiled content into simple http server container
FROM nginx
COPY --from=build /src/dist/ /usr/share/nginx/html/
COPY misc/default.conf /etc/nginx/conf.d/default.conf
24 changes: 24 additions & 0 deletions misc/default.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
server {
listen 80;
listen [::]:80;
server_name localhost;

location / {
root /usr/share/nginx/html;
try_files $uri $uri/ /index.html;
}

# make static files return proper 404 if not found instead of falling back on index.html
# and apply some caching
location ~* \.(webmanifest|xml|html|jpeg|jpg|gif|png|svg|ico)$ {
expires 1d;
root /usr/share/nginx/html;
}

# make static files return proper 404 if not found instead of falling back on index.html
# and apply heavy caching because these files should be hashed anyways
location ~* \.(js|css)$ {
expires 1y;
root /usr/share/nginx/html;
}
}

0 comments on commit 16fdb92

Please sign in to comment.