From 40ab6d1cd7942c89e3b99a2d8a7dbcec6cf7501b Mon Sep 17 00:00:00 2001 From: Marvin Steadfast Date: Wed, 19 Feb 2014 20:24:54 +0100 Subject: [PATCH] new article --- content/posts/2014/02/nginx-force-https.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 content/posts/2014/02/nginx-force-https.md diff --git a/content/posts/2014/02/nginx-force-https.md b/content/posts/2014/02/nginx-force-https.md new file mode 100644 index 0000000..0d150fe --- /dev/null +++ b/content/posts/2014/02/nginx-force-https.md @@ -0,0 +1,16 @@ +Title: NGINX force https +Slug: nginx-force-https +Date: 2014-02-19 20:18 +Tags: nginx, ssl, https + + +Am liebsten setze ich zur Zeit [NGINX](https://de.wikipedia.org/wiki/Nginx) als Webserver ein. Vor allem für meine Owncloud installation und ein paar Python Sachen. Das "Problem" war bis jetzt, dass er Anfragen auf "http" nicht auf "https" weitergeleitet hat. Nicht wirklich ein Problem, sondern nur nervig wenn man wiedermal vergessen hat explezit "https" davor zu schreiben. In der Config mit dem funktionierenden SSL-Server Teil schreibe ich einen zweiten "server"-Bereich: + + :::bash + server { + listen 80; + server_name cloud.xsteadfastx.org; + return 301 https://$server_name$request_uri; + } + +Viele regeln das mit Regex, laut NGINX-Wiki ist dies aber die saubere Methode.