From 418ecf67c298204d2505dfb455f321844bbf47e6 Mon Sep 17 00:00:00 2001 From: Emanuele Bertoldi Date: Fri, 13 Apr 2018 01:56:01 +0200 Subject: [PATCH] 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; } ```