fix: use exact match for /api/fonts location in nginx
- Changed from prefix match to exact match (location =) - Ensures /api/fonts takes priority over other location blocks - Removes unnecessary regex location block for API routes
This commit is contained in:
@@ -38,18 +38,13 @@ http {
|
|||||||
add_header Referrer-Policy "no-referrer-when-downgrade" always;
|
add_header Referrer-Policy "no-referrer-when-downgrade" always;
|
||||||
|
|
||||||
# API routes - serve as JSON (Next.js static export creates files without extensions)
|
# API routes - serve as JSON (Next.js static export creates files without extensions)
|
||||||
location /api/fonts {
|
# Use exact match to ensure this takes precedence
|
||||||
|
location = /api/fonts {
|
||||||
default_type application/json;
|
default_type application/json;
|
||||||
add_header Cache-Control "public, max-age=3600";
|
add_header Cache-Control "public, max-age=3600";
|
||||||
try_files /api/fonts =404;
|
try_files /api/fonts =404;
|
||||||
}
|
}
|
||||||
|
|
||||||
location ~ ^/api/ {
|
|
||||||
default_type application/json;
|
|
||||||
add_header Cache-Control "public, max-age=3600";
|
|
||||||
try_files $uri =404;
|
|
||||||
}
|
|
||||||
|
|
||||||
# Cache static assets
|
# Cache static assets
|
||||||
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot|flf)$ {
|
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot|flf)$ {
|
||||||
expires 1y;
|
expires 1y;
|
||||||
|
|||||||
Reference in New Issue
Block a user