Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
81 lines
2.8 KiB
Plaintext
81 lines
2.8 KiB
Plaintext
# Sitio estático de Collina Systems. nginx sin privilegios (puerto 8080) detrás
|
|
# de Traefik (Coolify), que termina TLS. Las cabeceras de seguridad se incluyen
|
|
# en cada location porque add_header no se hereda cuando un bloque define otras.
|
|
|
|
# Dominios secundarios: 301 al dominio canónico conservando la ruta.
|
|
server {
|
|
listen 8080;
|
|
listen [::]:8080;
|
|
server_name collinasystems.com.mx www.collinasystems.com.mx www.collinasystems.com;
|
|
server_tokens off;
|
|
location / {
|
|
return 301 https://collinasystems.com$request_uri;
|
|
}
|
|
}
|
|
|
|
# Dominio canónico. default_server: el healthcheck por 127.0.0.1 cae aquí.
|
|
server {
|
|
listen 8080 default_server;
|
|
listen [::]:8080 default_server;
|
|
server_name collinasystems.com _;
|
|
root /usr/share/nginx/html;
|
|
index index.html;
|
|
|
|
server_tokens off;
|
|
absolute_redirect off;
|
|
|
|
# Compresión: archivos precomprimidos en el build (.gz) y gzip al vuelo como respaldo.
|
|
gzip on;
|
|
gzip_static on;
|
|
gzip_vary on;
|
|
gzip_min_length 1024;
|
|
gzip_types text/plain text/css text/javascript application/javascript application/json application/xml image/svg+xml font/woff2;
|
|
|
|
include /etc/nginx/snippets/seguridad.conf;
|
|
|
|
# Assets con hash en el nombre: caché larga e inmutable.
|
|
location /_astro/ {
|
|
include /etc/nginx/snippets/seguridad.conf;
|
|
add_header Cache-Control "public, max-age=31536000, immutable";
|
|
try_files $uri =404;
|
|
}
|
|
|
|
# Fuentes: nombres estables; se renombran si cambian.
|
|
location /fonts/ {
|
|
include /etc/nginx/snippets/seguridad.conf;
|
|
add_header Cache-Control "public, max-age=31536000, immutable";
|
|
try_files $uri =404;
|
|
}
|
|
|
|
location ~* \.(png|jpg|jpeg|webp|avif|svg|ico|mp4|webm|pdf)$ {
|
|
include /etc/nginx/snippets/seguridad.conf;
|
|
add_header Cache-Control "public, max-age=604800";
|
|
try_files $uri =404;
|
|
}
|
|
|
|
# HTML: siempre revalidar.
|
|
location / {
|
|
include /etc/nginx/snippets/seguridad.conf;
|
|
add_header Cache-Control "no-cache";
|
|
try_files $uri $uri/ $uri.html =404;
|
|
}
|
|
|
|
error_page 404 /404.html;
|
|
|
|
# Rutas del sitio anterior.
|
|
location = /Productos.html { return 301 /proyectos; }
|
|
location = /Hablemos.html { return 301 /contacto; }
|
|
location = /Manifiesto.html { return 301 /firma; }
|
|
location = /Gobernanza.html { return 301 /ingenieria; }
|
|
location = /collina-insurance-manager.html { return 301 /proyectos/polizas; }
|
|
location = /prototypes/cotizador-collina-demo.html { return 301 /proyectos/cotizador; }
|
|
location = /prototypes/contract-maker-demo.html { return 301 /proyectos/contratos; }
|
|
location = /prototypes/cash-monitor-demo.html { return 301 /proyectos/monitor-gasolineras; }
|
|
|
|
location = /salud {
|
|
access_log off;
|
|
add_header Content-Type text/plain;
|
|
return 200 "ok\n";
|
|
}
|
|
}
|