Skip to content
Merged
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
4 changes: 2 additions & 2 deletions frontend/nginx/default.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
server {
server {
listen 8080;
server_name frontend;
gzip on;
Expand All @@ -9,7 +9,7 @@ server {
index index.html index.htm;
try_files $uri /index.html;
}
location ~* /[^/]*\.(?:ico|css|js|gif|jpe?g|png|woff2)$ {
location ~* ^(?!/api)/[^/]*\.(?:ico|css|js|gif|jpe?g|png|woff2)$ {
Copy link

Copilot AI Dec 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The regex pattern ^(?!/api)/[^/]*\.(?:ico|css|js|gif|jpe?g|png|woff2)$ will only match files directly in the root path (e.g., /style.css, /app.js) but will not match files in subdirectories (e.g., /assets/style.css, /static/app.js).

The pattern /[^/]*\. matches a single slash followed by any characters except slash, then a dot. This means it won't match paths like /static/bundle.js or /assets/logo.png.

If your frontend static files are served from subdirectories, consider using a pattern like:

location ~* ^(?!/api).*\.(?:ico|css|js|gif|jpe?g|png|woff2)$ {

This would match files at any depth while still excluding /api paths.

Suggested change
location ~* ^(?!/api)/[^/]*\.(?:ico|css|js|gif|jpe?g|png|woff2)$ {
location ~* ^(?!/api).*\.(?:ico|css|js|gif|jpe?g|png|woff2)$ {

Copilot uses AI. Check for mistakes.
root /var/www/html;
try_files $uri =404;
add_header Cache-Control "public, immutable, max-age=2592000";
Expand Down
Loading