Split nginx voorbeeldconfigs in pre- en post-certbot varianten, plus access/error logs
Continuous Integration / config (pull_request) Successful in 10s
Continuous Integration / prepare (pull_request) Successful in 1m13s
Continuous Integration / build (pull_request) Successful in 2m2s
Continuous Integration / test (pull_request) Successful in 1m51s
Continuous Integration / deploy-test (pull_request) Skipped
Continuous Integration / config (pull_request) Successful in 10s
Continuous Integration / prepare (pull_request) Successful in 1m13s
Continuous Integration / build (pull_request) Successful in 2m2s
Continuous Integration / test (pull_request) Successful in 1m51s
Continuous Integration / deploy-test (pull_request) Skipped
De reverse-proxy en analytics nginx-configs toonden al de door certbot beheerde eindstaat (met SSL-directives), terwijl je die juist nodig hebt vóórdat certbot draait. Nu is het .example-bestand de kale HTTP-versie om te kopiëren, met een apart .post-certbot.example ter referentie voor de staat erna. Alle configs (inclusief webserver-nginx.conf.example) hebben nu ook expliciete error_log/ access_log directives.
This commit is contained in:
+12
-24
@@ -9,45 +9,33 @@
|
||||
# poort is bewust 3001 (niet het gebruikelijke 3000), omdat Gitea op diezelfde
|
||||
# Pi al poort 3000 systeembreed bezet.
|
||||
#
|
||||
# Dit is de versie die je gebruikt VOORDAT certbot gedraaid heeft: alleen
|
||||
# poort 80, geen SSL. Certbot heeft dit HTTP-server-block namelijk nodig om
|
||||
# de ACME-challenge te kunnen afhandelen en zal, zodra je hem draait, dit
|
||||
# bestand zelf herschrijven om er de HTTPS-configuratie en de HTTP→HTTPS-
|
||||
# redirect aan toe te voegen. Zie analytics-nginx.conf.post-certbot.example
|
||||
# voor hoe het bestand er na die stap uit gaat zien (puur ter referentie —
|
||||
# dat bestand hoef je niet zelf te kopiëren, certbot genereert het).
|
||||
#
|
||||
# Kopieer dit bestand handmatig naar bijvoorbeeld
|
||||
# /etc/nginx/sites-available/slpsoftware-analytics.conf op de reverse-proxy-Pi,
|
||||
# maak een symlink in sites-enabled, en herlaad nginx.
|
||||
#
|
||||
# SSL-certificaat: net als voor test.slpsoftware.nl wordt dit aangevraagd met
|
||||
# certbot (Let's Encrypt), bijvoorbeeld:
|
||||
# maak een symlink in sites-enabled, herlaad nginx, en draai dan pas certbot:
|
||||
# sudo certbot --nginx -d analytics.slpsoftware.nl
|
||||
# Zorg dat het DNS-record voor analytics.slpsoftware.nl al naar het publieke
|
||||
# IP van deze Pi wijst voordat je certbot draait.
|
||||
|
||||
# HTTP: alleen gebruikt voor de Let's Encrypt ACME-challenge en om door te
|
||||
# verwijzen naar HTTPS. Na het draaien van certbot ziet dit block er zo uit.
|
||||
server {
|
||||
listen 80;
|
||||
listen [::]:80;
|
||||
|
||||
server_name analytics.slpsoftware.nl;
|
||||
|
||||
error_log /var/log/nginx/slpsoftware-analytics_error.log;
|
||||
access_log /var/log/nginx/slpsoftware-analytics_access.log;
|
||||
|
||||
location /.well-known/acme-challenge/ {
|
||||
root /var/www/certbot;
|
||||
}
|
||||
|
||||
location / {
|
||||
return 301 https://$host$request_uri;
|
||||
}
|
||||
}
|
||||
|
||||
# HTTPS: het daadwerkelijke reverse-proxy-verkeer naar Umami op de webserver-Pi.
|
||||
server {
|
||||
listen 443 ssl;
|
||||
listen [::]:443 ssl;
|
||||
|
||||
server_name analytics.slpsoftware.nl;
|
||||
|
||||
ssl_certificate /etc/letsencrypt/live/analytics.slpsoftware.nl/fullchain.pem;
|
||||
ssl_certificate_key /etc/letsencrypt/live/analytics.slpsoftware.nl/privkey.pem;
|
||||
include /etc/letsencrypt/options-ssl-nginx.conf;
|
||||
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
|
||||
|
||||
location / {
|
||||
proxy_pass http://192.168.1.103:3001;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user