From e5f43e605165ade948c8509140cdc4e5be029a56 Mon Sep 17 00:00:00 2001 From: greglebreton Date: Sat, 24 Jul 2021 11:26:08 +0200 Subject: [PATCH] maj readme --- README.md | 28 +++++++++++++++++++++++++++- nginx-proxy/nginx-proxy.conf | 8 +++++--- 2 files changed, 32 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 5470a17..a16abca 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,34 @@ Cette branche à pour but de conteneurisé un site HUGO compilé avec un server La configuration pour le NGINX reverse proxy en front se trouve dans le dossir nginx-proxy. ## CONFIG + +```bash +nano nginx-proxy/nginx.conf +``` -/\ Attention, le nom de domaine est à configuré dans les deux fichier de NGINX ! +/\ Attention, le nom de domaine est à configuré dans le proxy NGINX ! + +### Pour le HTTPS: + +Via Certbot: +```bash +sudo apt install certbot -y +sudo certbot certonly -d example.com +``` + +Une fois le certificat obtenu, décommenter les 3 lignes concernant le SSL en vérifiant +le nom des certificats en fonction du nom de domaine: +``` + #ssl on; + #ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem; + #ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem; +``` + +Redémarrer NGINX: + +```bash +sudo systemctl restart nginx +``` ## BUILD diff --git a/nginx-proxy/nginx-proxy.conf b/nginx-proxy/nginx-proxy.conf index 5b1a620..09f765b 100644 --- a/nginx-proxy/nginx-proxy.conf +++ b/nginx-proxy/nginx-proxy.conf @@ -1,3 +1,4 @@ +# HTTP server { listen 80; listen [::]:80; @@ -11,6 +12,7 @@ server { } +# HTTPS server{ listen 443 ssl http2; listen [::]:443 ssl http2; @@ -33,9 +35,9 @@ server{ return 302 https://example.com/index.xml; } - ssl on; - ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem; - ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem; + #ssl on; + #ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem; + #ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem; access_log /var/log/nginx/hugo_access.log; error_log /var/log/nginx/hugo_error.log;