# Configuración Nginx para mirrors.mx-os.mx como terminador TLS y proxy hacia Kubo server { listen 80; listen [::]:80; server_name mirrors.mx-os.mx; # Redirección forzada hacia HTTPS return 301 https://$host$request_uri; } server { http2 on; listen 443 ssl; listen [::]:443 ssl; server_name mirrors.mx-os.mx; # Certificados SSL Let's Encrypt ssl_certificate /etc/letsencrypt/live/mirrors.mx-os.mx/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/mirrors.mx-os.mx/privkey.pem; include /etc/letsencrypt/options-ssl-nginx.conf; ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # Encabezados de seguridad add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload" always; add_header X-Content-Type-Options "nosniff" always; add_header X-Frame-Options "SAMEORIGIN" always; add_header Referrer-Policy "strict-origin-when-cross-origin" always; # Proxy inverso transparente hacia el gateway de Kubo location / { proxy_pass http://127.0.0.1:8080/ipns/mirrors.mx-os.mx/; proxy_set_header Host 127.0.0.1:8080; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; # Deshabilitar buffering para flujo ágil de paquetes y artefactos de gran tamaño proxy_buffering off; proxy_read_timeout 300s; proxy_connect_timeout 10s; } }