Ir al contenido principal
kitlocal.dev

Chuleta de NGINX

Ejecución local

Procesado al 100 % en tu navegador. Las entradas y salidas nunca salen de tu dispositivo.

Directivas de configuración y operaciones CLI de NGINX: bloques server, cabeceras de proxy inverso, WebSockets, TLS, caché, compresión y limitación de tasa.

Cómo funciona

NGINX resolves `server { listen; server_name; }` first, then picks the most specific `location` block, forwarding or serving static files; always validate with `nginx -t` before `reload`.

Kit de supervivencia

Los comandos clave que conviene aprender primero.

40 comandos

Atajos de teclado/Enfocar búsquedaJKMover selecciónCCopiar seleccionadoFMarcar seleccionadoEscBorrar búsqueda

CLI Check, Reload & Logs

Validate syntax, reload without dropping connections, and inspect runtime config.

  • Esencial

    Test all included nginx configuration files for syntax and path errors

    nginx -t

    Cuándo usarlo

    Never reload NGINX without testing first; broken config aborts reload safely only if checked.

    Desglose

    -t
    Parse config and test validity without applying

    Ejemplo

    sudo nginx -t

    Resultado

    nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
    nginx: configuration file /etc/nginx/nginx.conf test is successful

Server Blocks, Locations & Static Files

Understand location matching precedence, SPA fallbacks, and clean redirects.

Reverse Proxy, Upstreams & WebSockets

Forward client IPs, HTTP/1.1 keepalives, WebSocket upgrades, and timeouts.

TLS, Security Headers & Rate Limits

Enforce HTTPS, TLS 1.2/1.3, security headers, and per-IP rate/size caps.

Compression, Caching & Tuning

Enable gzip, cache-control headers, worker limits, and proxy microcaching.

Pruébalo en una herramienta de KitLocal

Comprobado el 15 nov 2026 · Comprobado con NGINX 1.26+ / mainline

Fuentes: NGINX Documentation · NGINX ngx_http_proxy_module

Sustituye todo lo que esté entre corchetes angulares por tus propios valores. Los comandos proceden de la documentación oficial y los ejemplos se ejecutaron en la versión indicada.