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 < | ||
+ | |||
+ | # alles weiterleiten auf https | ||
+ | return 301 https:// | ||
+ | | ||
+ | # letsencrypt bündeln. (läuft nur auf http) | ||
+ | location / | ||
+ | alias / | ||
+ | } | ||
+ | } | ||
+ | |||
+ | server { | ||
+ | listen 443 ssl http2; | ||
+ | listen [::]:443 ssl http2; | ||
+ | server_name < | ||
+ | |||
+ | # Pfad zum letsencryp cert. Wird bestimmt durch die erste registrierte Domain im cert. | ||
+ | ssl_certificate / | ||
+ | ssl_certificate_key / | ||
+ | # HSTS aktivieren | ||
+ | #add_header Strict-Transport-Security " | ||
+ | |||
+ | # Dokument root der Seite. z.B. / | ||
+ | root < | ||
+ | # 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/ / | ||
+ | #} | ||
+ | |||
+ | # den Log sauberer halten | ||
+ | location = / | ||
+ | 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 / { | ||
+ | # | ||
+ | # # Manchmal müssen Header und co angepasst werden | ||
+ | # # | ||
+ | # # | ||
+ | # # | ||
+ | # # | ||
+ | #} | ||
+ | } | ||
+ | |||
+ | </ | ||
+ | |||