Zum Hauptinhalt springen
kitlocal.dev

NGINX-Cheatsheet

Läuft lokal

Zu 100 % in deinem Browser verarbeitet. Eingaben und Ausgaben verlassen niemals dein Gerät.

NGINX-Konfigurationsdirektiven und CLI-Abläufe: Server-Blöcke, Reverse-Proxy-Header, WebSockets, TLS, Caching, Kompression und Rate-Limiting.

Funktionsweise

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`.

Survival-Kit

Die wichtigsten Befehle für den Einstieg.

40 Befehle

Tastenkürzel/Suche fokussierenJKAuswahl bewegenCAuswahl kopierenFAuswahl als Lesezeichen speichernEscSuche leeren

CLI Check, Reload & Logs

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

  • Grundlagen

    Test all included nginx configuration files for syntax and path errors

    nginx -t

    Wann verwenden

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

    Aufbau

    -t
    Parse config and test validity without applying

    Beispiel

    sudo nginx -t

    Ergebnis

    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.

In einem KitLocal-Tool ausprobieren

Geprüft am 15.11.2026 · Geprüft mit NGINX 1.26+ / mainline

Quellen: NGINX Documentation · NGINX ngx_http_proxy_module

Ersetze Werte in spitzen Klammern durch deine eigenen Angaben. Befehle stammen aus der offiziellen Dokumentation, und Beispiele wurden mit der angegebenen Version ausgeführt.