docker/nginx.conf
Rama main · réplica de lectura del repositorio original.
server {
listen 8000;
listen [::]:8000;
server_name localhost;
# Root directory for DevTools frontend
root /usr/share/nginx/html;
index inspector.html devtools_app.html index.html;
# Compression
gzip on;
gzip_vary on;
gzip_min_length 1024;
gzip_types text/plain text/css text/xml text/javascript application/javascript application/xml+rss application/json application/wasm;
# 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;
# CORS headers for DevTools
add_header Access-Control-Allow-Origin "*" always;
add_header Access-Control-Allow-Methods "GET, POST, OPTIONS" always;
add_header Access-Control-Allow-Headers "DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range" always;
# Handle OPTIONS requests
if ($request_method = 'OPTIONS') {
return 204;
}
# Cache control for static assets
location ~* \.(jpg|jpeg|png|gif|ico|css|js|svg|woff|woff2|ttf|eot|avif)$ {
expires 1d;
add_header Cache-Control "public, immutable";
}
# Specific handling for WebAssembly files
location ~ \.wasm$ {
add_header Content-Type application/wasm;
}
# JSON files
location ~ \.json$ {
add_header Content-Type application/json;
}
# Main location
location / {
try_files $uri $uri/ /index.html;
}
# Specific paths for DevTools
location /front_end/ {
alias /usr/share/nginx/html/;
try_files $uri $uri/ =404;
}
# Error pages
error_page 404 /404.html;
location = /404.html {
internal;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
internal;
}
# Disable access logs for performance (can be enabled for debugging)
access_log off;
error_log /var/log/nginx/error.log warn;
}