Nginx Config Generator

HTTPS con Let's Encrypt
Gzip
Caché de assets (30 días)
Cabeceras de seguridad
server {
    listen 80;
    http2 off;
    server_name midominio.com;
    client_max_body_size 10M;
    root /var/www/midominio;
    index index.html index.htm;
    add_header X-Frame-Options "DENY" always;
    add_header X-Content-Type-Options "nosniff" always;

    location / {
        try_files $uri $uri/ =404;
    }

    location ~* \.(css|js|jpg|jpeg|png|gif|svg|webp|avif|woff2?)$ {
        expires 30d;
        add_header Cache-Control "public, immutable";
    }
}

# En el bloque http {} de /etc/nginx/nginx.conf:
# gzip on;
# gzip_types text/plain text/css application/json application/javascript image/svg+xml;
# gzip_min_length 1024;
# gzip_comp_level 6;

⚡ por MACM · miguelacm.es