New site frontend updates, search, and general bug fixes
This commit is contained in:
@@ -5,6 +5,14 @@ server {
|
||||
root /config/www;
|
||||
index index.html;
|
||||
|
||||
# CRITICAL: Include MIME types
|
||||
include /etc/nginx/mime.types;
|
||||
|
||||
# Handle trailing slashes for directories
|
||||
location ~ ^([^.]*[^/])$ {
|
||||
try_files $uri $uri/ $uri.html =404;
|
||||
}
|
||||
|
||||
# CORS configuration for search index
|
||||
location /search/search_index.json {
|
||||
add_header 'Access-Control-Allow-Origin' '*' always;
|
||||
@@ -16,9 +24,26 @@ server {
|
||||
}
|
||||
}
|
||||
|
||||
# General CORS for all requests (optional)
|
||||
# Main location block
|
||||
location / {
|
||||
add_header 'Access-Control-Allow-Origin' '*' always;
|
||||
try_files $uri $uri/ =404;
|
||||
try_files $uri $uri/ $uri/index.html $uri.html /index.html =404;
|
||||
}
|
||||
|
||||
# Handle 404 with MkDocs 404 page
|
||||
error_page 404 /404.html;
|
||||
location = /404.html {
|
||||
internal;
|
||||
}
|
||||
|
||||
# Static assets
|
||||
location ~* \.(css|js|jpg|jpeg|png|gif|ico|svg|woff|woff2|ttf|eot)$ {
|
||||
add_header 'Access-Control-Allow-Origin' '*' always;
|
||||
expires 30d;
|
||||
add_header Cache-Control "public, immutable";
|
||||
}
|
||||
|
||||
# Enable gzip
|
||||
gzip on;
|
||||
gzip_types text/plain text/css text/javascript application/javascript application/json;
|
||||
}
|
||||
Reference in New Issue
Block a user