Module
| ↩ Zurück zur Startseite |
Nginx ist modular aufgebaut und besitzt einige Kernmodule, weitere optionale Module und auch Drittanbieter Module sind erhältlich.
Contents |
[edit] Nginx Kompilieren
Nginx Module müssen während der Übersetzungszeit mit-kompiliert werden. Eine komplette Liste aller Optionen, inklusive optionaler Module, finden Sie bei den Übersetzungsoptionen.
Beispiel:
./configure \ --prefix=/usr \ --sbin-path=/usr/sbin/nginx \ --conf-path=/etc/nginx/nginx.conf \ --error-log-path=/var/log/nginx/error.log \ --pid-path=/var/run/nginx/nginx.pid \ --lock-path=/var/lock/nginx.lock \ --user=nginx \ --group=nginx \ --with-http_ssl_module \ --with-http_flv_module \ --with-http_gzip_static_module \ --http-log-path=/var/log/nginx/access.log \ --http-client-body-temp-path=/var/tmp/nginx/client/ \ --http-proxy-temp-path=/var/tmp/nginx/proxy/ \ --http-fastcgi-temp-path=/var/tmp/nginx/fcgi/
Die aktuellste Liste an Übersetzungsoptionen, passend zu ihrer nginx Version, erhalten Sie mit dem Kommando ./configure --help.
[edit] Kernmodule
Diese Module werden von nginx zum korrekten Betrieb benötigt.
[edit] Hauptmodul
Konfigurationsfehlerlogging, Prozesse, Zugriffsberechtigungen, etc.
user nginx; worker_processes 2; error_log logs/error.log; pid logs/nginx.pid; worker_rlimit_nofile 8192;
[edit] Ereignismodul
Konfiguration von epoll, kqueue, select, poll, etc.
events {
use kqueue;
worker_connections 4096;
}
[edit] Standard-HTTP-Module
Die nachfolgenden Module werden automatisch mit-kompiliert, außer wenn sie explizit mit configure ausgeschlossen werden.
[edit] HTTP-Kernmodul
Kontrolliert die Ports, Fehlerseiten, Aliase und andere grundlegende Dienste.
http {
sendfile on;
tcp_nopush on;
server {
listen 80;
}
}
[edit] HTTP-Upstreammodul
Für Lastverteilung.
upstream backend {
server b1.example.com weight=5;
server b2.example.com:81;
server unix:/tmp/backend3;
}
server {
location / {
proxy_pass http://backend;
}
}
[edit] HTTP-Zugriffsmodul
Zugriffskontrolle basierend auf IP-Adressen.
location / {
deny 192.168.1.1;
allow 192.168.1.0/24;
allow 10.1.1.0/16;
deny all;
}
[edit] HTTP-Authentifizierungsmodul
Grundlegende HTTP-Authentifizierung.
location / {
auth_basic "Restricted";
auth_basic_user_file conf/htpasswd;
}
[edit] FastCGI Modul
FastCGI Unterstützung.
location \.php$ {
include fastcgi_conf;
fastcgi_pass localhost:9000;
fastcgi_index index.php;
}
[edit] Optionale-HTTP-Module
[edit] Mail-Module
[edit] Drittanbieter-Module
Siehe Erweiterungen.
[edit] Quellen
- NginxModules (Englisch)
















