From 12139fac3ac3418fca699f5ef4784ed5d9460dcd Mon Sep 17 00:00:00 2001 From: wiz Date: Sun, 1 Dec 2019 11:50:14 +0900 Subject: [PATCH] Fix incorrect nginx/certbot instructions in README --- README.md | 14 +++++++++++--- nginx.conf | 32 ++++++++++++++++---------------- 2 files changed, 27 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 65c21185f..d69951317 100644 --- a/README.md +++ b/README.md @@ -148,14 +148,22 @@ When it's ready you will see output like this: ``` ## nginx + CertBot (LetsEncrypt) -Setup nginx using the supplied nginx.conf, replacing `example.com` with your domain name. +Setup nginx using the supplied nginx.conf ```bash + # install nginx and certbot apt-get install -y nginx python-certbot-nginx + + # replace example.com with your domain name + certbot --nginx -d example.com + + # install the mempool configuration for nginx cp nginx.conf /etc/nginx/nginx.conf - certbot -d example.com # replace with your domain name + + # edit the installed nginx.conf, and replace all + # instances of example.com with your domain name ``` -Make sure you can access https://example.com/ in browser before proceeding +Make sure you can access https:/// in browser before proceeding ## Running (Frontend) diff --git a/nginx.conf b/nginx.conf index ce22a7a60..f1d105355 100644 --- a/nginx.conf +++ b/nginx.conf @@ -37,22 +37,22 @@ http { listen [::]:80; server_name example.com; -# if ($host = example.com) { -# return 301 https://$host$request_uri; -# } # managed by Certbot -# -# return 404; # managed by Certbot -# } -# -# server { -# listen [::]:443 ssl http2; # managed by Certbot -# listen 443 ssl http2; # managed by Certbot -# ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem; # managed by Certbot -# ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem; # managed by Certbot -# include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot -# ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot -# -# server_name example.com; # managed by Certbot + if ($host = example.com) { + return 301 https://$host$request_uri; + } # managed by Certbot + + return 404; # managed by Certbot + } + + server { + listen [::]:443 ssl http2; # managed by Certbot + listen 443 ssl http2; # managed by Certbot + ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem; # managed by Certbot + ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem; # managed by Certbot + include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot + ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot + + server_name example.com; # managed by Certbot index index.html; root /var/www/html;