This commit is contained in:
2025-06-26 20:05:02 +00:00
parent 7908feebf3
commit c22b86e19f
84 changed files with 234 additions and 3726 deletions

View File

@@ -3,24 +3,24 @@ server {
server_name localhost;
root /static-files;
# Serve static files
location / {
try_files $uri $uri/ =404;
# Add CORS headers for all requests
if ($request_method = 'OPTIONS') {
add_header Access-Control-Allow-Origin "*" always;
add_header Access-Control-Allow-Methods "GET, POST, OPTIONS" always;
add_header Access-Control-Allow-Methods "GET, OPTIONS" always;
add_header Access-Control-Allow-Headers "Origin, Content-Type, Accept, Authorization" always;
# Handle preflight requests
if ($request_method = 'OPTIONS') {
return 204;
}
# Set proper content type for markdown files
location ~* \.md$ {
add_header Content-Type "text/markdown; charset=utf-8";
# CORS headers are inherited from parent location
}
return 204;
}
# Only serve markdown files
location ~* \.md$ {
try_files $uri =404;
add_header Content-Type "text/markdown; charset=utf-8" always;
add_header Access-Control-Allow-Origin "*" always;
add_header Access-Control-Allow-Methods "GET, Options" always;
add_header Access-Control-Allow-Headers "Origin, Content-Type, Accept, Authorization" always;
}
# Return 404 for everything else
location / {
return 404;
}
}