From 418ecf67c298204d2505dfb455f321844bbf47e6 Mon Sep 17 00:00:00 2001 From: Emanuele Bertoldi Date: Fri, 13 Apr 2018 01:56:01 +0200 Subject: [PATCH 1/4] Improve docs for default site with HTTPS Provide a working solution of default site configuration for both HTTP and HTTPS requests. --- docs/configuration/domains.md | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/docs/configuration/domains.md b/docs/configuration/domains.md index 461e20eae..0b4810be1 100644 --- a/docs/configuration/domains.md +++ b/docs/configuration/domains.md @@ -131,12 +131,20 @@ Create the file at `/etc/nginx/conf.d/00-default-vhost.conf`: ```nginx server { - listen 80 default_server; - listen [::]:80 default_server; + listen 80 default_server; + server_name _; + access_log off; + return 410; +} - server_name _; - return 410; - log_not_found off; +# For HTTPS requests you can enable this section: +# (You need a SSL certificate in /etc/nginx/ssl/) +server { +# listen 443 ssl; +# server_name _; +# ssl_certificate /etc/nginx/ssl/cert.crt; +# ssl_certificate_key /etc/nginx/ssl/cert.key; +# return 410; } ``` From 90876646674acf2eebf8c782de47ee091d943810 Mon Sep 17 00:00:00 2001 From: Emanuele Bertoldi Date: Sat, 14 Apr 2018 01:10:56 +0200 Subject: [PATCH 2/4] Expand docs for default site over HTTPS --- docs/configuration/domains.md | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/docs/configuration/domains.md b/docs/configuration/domains.md index 0b4810be1..37883f2f2 100644 --- a/docs/configuration/domains.md +++ b/docs/configuration/domains.md @@ -137,15 +137,20 @@ server { return 410; } -# For HTTPS requests you can enable this section: -# (You need a SSL certificate in /etc/nginx/ssl/) -server { -# listen 443 ssl; -# server_name _; -# ssl_certificate /etc/nginx/ssl/cert.crt; -# ssl_certificate_key /etc/nginx/ssl/cert.key; -# return 410; -} +# To handle HTTPS requests too you can uncomment the following section. +# +# Please note that in order to let this work as expected, you need a valid +# SSL certificate for your domain. +# +# By default *.crt and *.key files need to be copied into /etc/nginx/ssl/ folder. +# +# server { +# listen 443 ssl; +# server_name _; +# ssl_certificate /etc/nginx/ssl/cert.crt; +# ssl_certificate_key /etc/nginx/ssl/cert.key; +# return 410; +# } ``` Make sure to reload nginx after creating this file by running `service nginx reload`. From 6b78375cdc2399d93164660963fbbd9f375628db Mon Sep 17 00:00:00 2001 From: Emanuele Bertoldi Date: Sat, 14 Apr 2018 01:12:49 +0200 Subject: [PATCH 3/4] Save some chars --- docs/configuration/domains.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/configuration/domains.md b/docs/configuration/domains.md index 37883f2f2..395a58fe7 100644 --- a/docs/configuration/domains.md +++ b/docs/configuration/domains.md @@ -142,7 +142,7 @@ server { # Please note that in order to let this work as expected, you need a valid # SSL certificate for your domain. # -# By default *.crt and *.key files need to be copied into /etc/nginx/ssl/ folder. +# By default .crt/.key files need to be copied into /etc/nginx/ssl/ folder. # # server { # listen 443 ssl; From ff27908dfdaa6a2d2028ca2241475e4060b97aa7 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Thu, 26 Apr 2018 19:51:27 -0400 Subject: [PATCH 4/4] docs: cleanup ssl wildcard docs --- docs/configuration/domains.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/configuration/domains.md b/docs/configuration/domains.md index 395a58fe7..bddefca29 100644 --- a/docs/configuration/domains.md +++ b/docs/configuration/domains.md @@ -137,18 +137,21 @@ server { return 410; } -# To handle HTTPS requests too you can uncomment the following section. +# To handle HTTPS requests, you can uncomment the following section. # # Please note that in order to let this work as expected, you need a valid -# SSL certificate for your domain. +# SSL certificate for any domains being served. Browsers will show SSL +# errors in all other cases. # -# By default .crt/.key files need to be copied into /etc/nginx/ssl/ folder. +# Note that the key and certificate files in the below example need to +# be copied into /etc/nginx/ssl/ folder. # # server { # listen 443 ssl; # server_name _; # ssl_certificate /etc/nginx/ssl/cert.crt; # ssl_certificate_key /etc/nginx/ssl/cert.key; +# access_log off; # return 410; # } ```