docloud.es/nginx.conf
Deploy Bot eef3370f76
All checks were successful
Deploy Site / deploy (push) Successful in 34s
Initial setup docloud.es - sitio principal con index
2026-01-06 10:49:04 +00:00

55 lines
1.4 KiB
Nginx Configuration File

server {
listen 80;
server_name localhost;
root /usr/share/nginx/html;
index index.html;
# Gzip compression
gzip on;
gzip_vary on;
gzip_min_length 1024;
gzip_types text/plain text/css text/xml text/javascript application/javascript application/json application/xml image/svg+xml;
# Health check endpoint para monitorización
location = /health {
access_log off;
add_header Content-Type text/plain;
return 200 'OK';
}
# robots.txt - servir directamente
location = /robots.txt {
default_type text/plain;
try_files $uri =404;
}
# sitemap.xml - servir directamente
location = /sitemap.xml {
default_type application/xml;
try_files $uri =404;
}
# Cache para assets estaticos (1 año)
location ~* \.(css|js|jpg|jpeg|png|gif|ico|svg|woff|woff2|ttf|eot)$ {
expires 1y;
add_header Cache-Control "public, immutable";
access_log off;
}
# Cache para HTML (5 minutos)
location ~* \.html$ {
expires 5m;
add_header Cache-Control "public, must-revalidate";
}
# SPA fallback (solo para rutas que no existen)
location / {
try_files $uri $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;
}