Add minio support and forntend analitycs
This commit is contained in:
@@ -34,20 +34,47 @@ server {
|
||||
# Note: API routing is handled by ingress, not by this nginx
|
||||
# The frontend makes requests to /api which are routed by the ingress controller
|
||||
|
||||
# Static assets with aggressive caching (including source maps for debugging)
|
||||
location ~* ^/assets/.*\.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot|map)$ {
|
||||
expires 1y;
|
||||
add_header Cache-Control "public, immutable";
|
||||
add_header Vary Accept-Encoding;
|
||||
# Source map files - serve with proper CORS headers and content type
|
||||
# Note: These are typically only needed in development, but served in production for error reporting
|
||||
location ~* ^/assets/.*\.map$ {
|
||||
# Short cache time to avoid mismatches with JS files
|
||||
expires 1m;
|
||||
add_header Cache-Control "public, must-revalidate";
|
||||
add_header Access-Control-Allow-Origin "*";
|
||||
add_header Access-Control-Allow-Methods "GET";
|
||||
add_header Access-Control-Allow-Headers "Content-Type";
|
||||
add_header Content-Type "application/json";
|
||||
# Disable access logging for source maps as they're requested frequently
|
||||
access_log off;
|
||||
try_files $uri =404;
|
||||
}
|
||||
|
||||
# Also handle JS and CSS files anywhere in the structure (for dynamic imports)
|
||||
location ~* \.(js|css)$ {
|
||||
# Static assets with appropriate caching
|
||||
# Note: JS/CSS files have content hashes for cache busting, but use shorter cache times to handle deployment issues
|
||||
location ~* ^/assets/.*\.(js|css)$ {
|
||||
expires 1h;
|
||||
add_header Cache-Control "public";
|
||||
add_header Vary Accept-Encoding;
|
||||
add_header Access-Control-Allow-Origin "*";
|
||||
access_log off;
|
||||
try_files $uri =404;
|
||||
}
|
||||
|
||||
# Static assets that don't change often (images, fonts) can have longer cache times
|
||||
location ~* ^/assets/.*\.(png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
|
||||
expires 1y;
|
||||
add_header Cache-Control "public, immutable";
|
||||
add_header Vary Accept-Encoding;
|
||||
add_header Access-Control-Allow-Origin "*";
|
||||
access_log off;
|
||||
try_files $uri =404;
|
||||
}
|
||||
|
||||
# Handle JS and CSS files anywhere in the structure (for dynamic imports) with shorter cache
|
||||
location ~* \.(js|css)$ {
|
||||
expires 1h;
|
||||
add_header Cache-Control "public";
|
||||
add_header Vary Accept-Encoding;
|
||||
access_log off;
|
||||
try_files $uri =404;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user