nginx_nginx_-_infos

no way to compare when less than two revisions

Differences

This shows you the differences between two versions of the page.


nginx_nginx_-_infos [2018/02/03 19:31] (current) – created rellig
Line 1: Line 1:
 +====== Nginx ======
 +
 +===== Beispiel conf =====
 +
 +<file bash ->
 +server {
 +        listen 80;
 +        listen [::]:80;
 +        server_name <domains>; # z.B. minad.de www.minad.de
 +
 +        # alles weiterleiten auf https
 +        return 301 https://$host$request_uri;
 +        
 +        # letsencrypt bündeln. (läuft nur auf http)
 +        location /.well-known {
 +            alias /var/www/letsencrypt/.well-known;
 +        }
 +}
 +
 +server {
 +        listen 443 ssl http2;
 +        listen [::]:443 ssl http2;
 +        server_name <domains>; # die gleichen Domains wie oben
 +
 +        # Pfad zum letsencryp cert. Wird bestimmt durch die erste registrierte Domain im cert.
 +        ssl_certificate /etc/letsencrypt/live/<domain>/fullchain.pem;
 +        ssl_certificate_key /etc/letsencrypt/live/<domain>/privkey.pem;
 +        # HSTS aktivieren
 +        #add_header Strict-Transport-Security "max-age=31536000";
 +
 +        # Dokument root der Seite. z.B. /var/www/htdocs/
 +        root <pfad>;
 +        # welche Datei(en) als index behandelt werden soll. Auch sinnvoll: index.html index.htm
 +        index index.php;
 +
 +        # enable for php7.2
 +        include fpm-php7.2;
 +        # enable for php5.6
 +        #include fpm-php5.6
 +
 +        # magic für WordPress
 +        #location / {
 +        #        try_files $uri $uri/ /index.php?$args;
 +        #}
 +
 +        # den Log sauberer halten
 +        location = /favicon.ico {
 +                log_not_found off;
 +                access_log off;
 +        }
 +        location = /robots.txt {
 +                allow all;
 +                log_not_found off;
 +                access_log off;
 +        }
 +
 +        # besser cachen. Freut auch google
 +        #location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
 +        #        expires 1M;
 +        #        log_not_found off;
 +        #}
 +        
 +        # einen reverse-proxy verwenden
 +        #location / {
 +        #         proxy_pass <url>; # url vom eigentlichen Ziel
 +        #         # Manchmal müssen Header und co angepasst werden
 +        #         #proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
 +        #         #proxy_set_header Host $http_host;
 +        #         #proxy_set_header X-Real-IP $remote_addr;
 +        #         #proxy_redirect off;
 +        #}
 +}
 +
 +</file>
 +
  
  • nginx_nginx_-_infos.txt
  • Last modified: 2018/02/03 19:31
  • by rellig