Updated try_files directive to check for index.html in subdirectories before falling back to root index.html. This fixes /sdk routing. Before: try_files $uri $uri/ /index.html; After: try_files $uri $uri/index.html /index.html; Now /sdk correctly serves /sdk/index.html instead of root index.html 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
29 lines
689 B
Plaintext
29 lines
689 B
Plaintext
server {
|
|
listen 80;
|
|
server_name localhost;
|
|
|
|
root /usr/share/nginx/html;
|
|
index index.html;
|
|
|
|
# Enable gzip compression
|
|
gzip on;
|
|
gzip_types text/css application/javascript image/jpeg image/png;
|
|
gzip_min_length 1000;
|
|
|
|
# Cache static assets
|
|
location ~* \.(jpg|jpeg|png|gif|ico|css|js)$ {
|
|
expires 1y;
|
|
add_header Cache-Control "public, immutable";
|
|
}
|
|
|
|
# Main location
|
|
location / {
|
|
try_files $uri $uri/index.html /index.html;
|
|
}
|
|
|
|
# Security headers
|
|
add_header X-Frame-Options "SAMEORIGIN" always;
|
|
add_header X-Content-Type-Options "nosniff" always;
|
|
add_header X-XSS-Protection "1; mode=block" always;
|
|
}
|