From ca7a37f6898c74df93f2ea4809fe624cbd270db2 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 5 Aug 2019 12:07:26 +0200 Subject: [PATCH] nginx/serve/redirect --- in/public/web/nginx/serve.rst | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/in/public/web/nginx/serve.rst b/in/public/web/nginx/serve.rst index 443eeec..ed8a2b2 100644 --- a/in/public/web/nginx/serve.rst +++ b/in/public/web/nginx/serve.rst @@ -1,10 +1,9 @@ -***** Serve -***** +===== * /etc/nginx/sites-available/… -.. code:: +:: server { listen 80; @@ -35,3 +34,14 @@ Serve } } +Redirect http to https +---------------------- + +:: + + server { + listen 80 default_server; + listen [::]:80 default_server; + server_name _; + return 301 https://${host}${request_uri}; + }