i18n/de/skills/configure-nginx/SKILL.md
Konfiguriere Nginx als Webserver und Reverse Proxy. Umfasst statische Dateiauslieferung, Reverse Proxy zu Upstream-Diensten, SSL/TLS-Terminierung mit Let's Encrypt, Location-Bloecke, Lastverteilung, Rate Limiting und Sicherheitsheader. Verwende diesen Skill beim Ausliefern statischer Dateien in Produktion, beim Reverse-Proxying zu Backend-Diensten (Node.js, Python, R/Shiny), bei SSL/TLS-Terminierung, bei Lastverteilung ueber Instanzen oder beim Hinzufuegen von Rate Limiting und Sicherheitsheadern zur Haertung eines Endpunkts.
npx skillsauth add pjt222/agent-almanac configure-nginxInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Nginx als Webserver und Reverse Proxy mit SSL-Terminierung und Sicherheitshaertung einrichten.
nginx.conf:
events {
worker_connections 1024;
}
http {
upstream app {
server app:3000;
}
server {
listen 80;
server_name example.com;
location / {
proxy_pass http://app;
proxy_set_header Host $host;
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;
}
}
}
Docker-Compose-Dienst:
services:
nginx:
image: nginx:1.27-alpine
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
depends_on:
- app
Erwartet: Anfragen an Port 80 werden an den App-Dienst weitergeleitet.
server {
listen 80;
root /usr/share/nginx/html;
index index.html;
location / {
try_files $uri $uri/ /index.html;
}
location /assets/ {
expires 1y;
add_header Cache-Control "public, immutable";
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff2?)$ {
expires 6M;
add_header Cache-Control "public";
}
}
Mit certbot und der Webroot-Methode:
server {
listen 80;
server_name example.com;
location /.well-known/acme-challenge/ {
root /var/www/certbot;
}
location / {
return 301 https://$host$request_uri;
}
}
server {
listen 443 ssl;
server_name example.com;
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
location / {
proxy_pass http://app;
proxy_set_header Host $host;
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;
}
}
Docker Compose mit certbot:
services:
nginx:
image: nginx:1.27-alpine
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
- certbot-webroot:/var/www/certbot:ro
- certbot-certs:/etc/letsencrypt:ro
certbot:
image: certbot/certbot
volumes:
- certbot-webroot:/var/www/certbot
- certbot-certs:/etc/letsencrypt
volumes:
certbot-webroot:
certbot-certs:
Erstes Zertifikat:
docker compose run --rm certbot certonly \
--webroot -w /var/www/certbot \
-d example.com --email [email protected] --agree-tos
Erwartet: HTTPS funktioniert mit gueltigem Let's-Encrypt-Zertifikat.
Bei Fehler: DNS-Eintrag pruefen, ob er auf den Server zeigt. Sicherstellen, dass Port 80 fuer ACME-Challenges offen ist.
server {
# ... SSL-Konfiguration oben ...
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-Content-Type-Options "nosniff" always;
add_header X-XSS-Protection "1; mode=block" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
add_header Strict-Transport-Security "max-age=63072000; includeSubDomains" always;
add_header Content-Security-Policy "default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline';" always;
# Nginx-Version verbergen
server_tokens off;
}
http {
# Rate-Limit-Zonen definieren
limit_req_zone $binary_remote_addr zone=api:10m rate=10r/s;
limit_req_zone $binary_remote_addr zone=login:10m rate=1r/s;
server {
location /api/ {
limit_req zone=api burst=20 nodelay;
proxy_pass http://app;
}
location /login {
limit_req zone=login burst=5;
proxy_pass http://app;
}
}
}
upstream app {
least_conn;
server app1:3000;
server app2:3000;
server app3:3000 backup;
}
| Methode | Direktive | Verhalten |
|---------|-----------|-----------|
| Round Robin | (Standard) | Gleichmaessige Verteilung |
| Wenigste Verbindungen | least_conn | Leitet an am wenigsten ausgelasteten weiter |
| IP-Hash | ip_hash | Sticky Sessions |
| Gewichtet | server app:3000 weight=3 | Proportional |
# Konfigurationssyntax testen
docker compose exec nginx nginx -t
# Ohne Ausfallzeit neu laden
docker compose exec nginx nginx -s reload
# Antwortheader pruefen
curl -I https://example.com
Erwartet: nginx -t meldet Syntax OK. Header enthalten Sicherheitsheader.
nginx -t meldet gueltige Konfigurationproxy_set_header Host: Backend erhaelt falschen Host-Header, was virtuelle Hosts und Weiterleitungen bricht.location-Reihenfolge ist wichtig: Nginx verwendet den spezifischsten Treffer. Exakt (=) > Praefix (^~) > Regex (~) > allgemeiner Praefix.certbot renew einrichten und Nginx neu laden.client_max_body_size ist 1MB. Fuer Datei-Uploads erhoehen: client_max_body_size 50m;.configure-reverse-proxy fuer das Muster.configure-reverse-proxy - Multi-Tool-Proxy-Muster einschliesslich WebSocket und Traefiksetup-compose-stack - Compose-Stack mit Nginxdeploy-searxng - Verwendet Nginx als Frontend fuer SearXNGconfigure-ingress-networking - Kubernetes Ingress (NGINX Ingress Controller)testing
Launch all available agents in parallel waves for open-ended hypothesis generation on problems where the correct domain is unknown. Use when facing a cross-domain problem with no clear starting point, when single-agent approaches have stalled, or when diverse perspectives are more valuable than deep expertise. Produces a ranked hypothesis set with convergence analysis and adversarial refinement.
tools
Write integration tests for a Node.js CLI application using the built-in node:test module. Covers the exec helper pattern, output assertions, filesystem state verification, cleanup hooks, JSON output parsing, error case testing, and state restoration after destructive tests. Use when adding tests to an existing CLI, testing a new command, verifying adapter behavior across frameworks, or setting up CI for a CLI tool.
development
Screen a proposed trademark for conflicts and distinctiveness before filing. Covers trademark database searches (TMview, WIPO Global Brand Database, USPTO TESS), distinctiveness analysis using the Abercrombie spectrum, likelihood of confusion assessment using DuPont factors and EUIPO relative grounds, common law rights evaluation, and goods/services overlap analysis. Produces a conflict report with a risk matrix. Use before adopting a new brand name, logo, or slogan — distinct from patent prior art search, which uses different databases, legal frameworks, and analysis methods.
tools
Scaffold a new CLI command using Commander.js with options, action handler, three output modes (human-readable, quiet, JSON), and optional ceremony variant. Covers command naming, option design, shared context patterns, error handling, and integration testing. Use when adding a command to an existing Commander.js CLI, designing a new CLI tool from scratch, or standardizing command structure across a multi-command CLI.