Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix frontend internal webserver for routing non-# urls #79

Merged
merged 1 commit into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
}
}
Loading