Nginx: Unterschied zwischen den Versionen

Aus Xinux Wiki
Zur Navigation springen Zur Suche springen
Tippfehler-Link korrigiert, ModSecurity als historisch markiert, neue Module ergaenzt
 
(24 dazwischenliegende Versionen von 2 Benutzern werden nicht angezeigt)
Zeile 1: Zeile 1:
= Installation =
*[[Nginx Grundlagen]]
 
*[[Nginx Basis]]
* '''sudo apt install nginx'''
*[[Nginx Individuelle Seiten]]
 
*[[Nginx HTTP Standard Seite]]
=Start=
*[[Nginx HTTPS Standard Seite]]
*systemctl start nginx
*[[Nginx IPs]]
=Stop=
*[[Nginx Zertifikate]]
*systemctl stop nginx
*[[Nginx HTTPS Virtueller Host]]
=Restart=
*[[Nginx HTTP auf HTTPS weiterleiten]]
*systemctl restart nginx
*[[Nginx HTTPS inklusive Client Zertifikat]]
=Reload=
*[[Nginx Client Zertifikat mit 2FA]]
*systemctl reload nginx
*[[Nginx Webproxy für HTTPS]]
 
*[[Nginx mit Modsecurity]] (historisch, siehe [[Reverse Proxy]] für den aktuellen WAF-Ansatz mit HAProxy/Coraza)
=Status=
*[[Nginx mit Modsecurity und Blocklist Policy]] (historisch)
*systemctl status nginx
*[[Nginx php]]
=Port check=
*[[Nginx Beispielwebsite]]
*netstat -lntp | grep nginx
*[[Nginx Beispielproxy]]
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      1438/nginx -g daemo
*[[Nginx Grundkonfiguration]] (Animation)
tcp6      0      0 :::80                  :::*                   LISTEN      1438/nginx -g daemo
*[[Nginx Reverse Proxy und Load Balancing]]
=Content=
*[[Nginx Lets Encrypt und Certbot]]
*/var/www/html
*[[Nginx Absichern und Betreiben]]
=Config=
*/etc/nginx
The nginx configuration directory. All of the Nginx configuration files reside here.
*/etc/nginx/nginx.conf
The main Nginx configuration file. This can be modified to make changes to the Nginx global configuraiton.
*/etc/nginx/sites-available
The directory where per-site "server blocks" can be stored. Nginx will not use the configuration files found in this directory unless they are linked to the sites-enabled directory (see below). Typically, all server block configuration is done in this directory, and then enabled by linking to the other directory.
*/etc/nginx/sites-enabled/
The directory where enabled per-site "server blocks" are stored. Typically, these are created by linking to configuration files found in the sites-available directory.
*/etc/nginx/snippets
This directory contains configuration fragments that can be included elsewhere in the Nginx configuration. Potentially repeatable configuration segments are good candidates for refactoring into snippets.
=Server Logs=
*/var/log/nginx/access.log
Every request to your web server is recorded in this log file unless Nginx is configured to do otherwise.
*/var/log/nginx/error.log
Any Nginx errors will be recorded in this log.
=Config files=
*/etc/nginx/nginx.conf
<pre>
user www-data;
worker_processes auto;
pid /run/nginx.pid;
events {
        worker_connections 768;
}
http {
        sendfile on;
        tcp_nopush on;
        tcp_nodelay on;
        keepalive_timeout 65;
        types_hash_max_size 2048;
        include /etc/nginx/mime.types;
        default_type application/octet-stream;
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
        ssl_prefer_server_ciphers on;
        access_log /var/log/nginx/access.log;
        error_log /var/log/nginx/error.log;
        gzip on;
        gzip_disable "msie6";
        include /etc/nginx/conf.d/*.conf;
        include /etc/nginx/sites-enabled/*;
}
</pre>
==Explanation==
===user===
The user under the proccess is running.
===pid===
The file where the proccessid ist stored.
===keepalive_timeout===
The time as long as the connection is established.
 
===http===
The http section.
===include===
With include other files are integrated.
===ssl_protocols===
Available ssl protocols
===access_log===
Location of the access.log
===error_log===
Location of the error.log
 
=Individuelle Konfiguration=
Es gibt 2 Verzeichnisse hierfür
/etc/nginx/sites-available/
/etc/nginx/sites-enabled/
Alles was nach sites-enabled verlinkt wird ist aktiviert
*[[nxinx http]]
*[[nxinx https]]
 
 
=Links=
*https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-ubuntu-16-04
 
 
*[[Nginx Installation & Konfiguration]]

Aktuelle Version vom 31. Oktober 2026, 15:16 Uhr