From 9443ee24566e090c14a72fface867c971064dd3d Mon Sep 17 00:00:00 2001 From: RainerEmrich Date: Sun, 27 May 2018 10:42:43 +0000 Subject: [PATCH] Add rewrite condition. modified: patches/etc.apache2.sites-available.000-default.conf.patch --- ...he2.sites-available.000-default.conf.patch | 24 ++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/patches/etc.apache2.sites-available.000-default.conf.patch b/patches/etc.apache2.sites-available.000-default.conf.patch index 53d1953..c8caacc 100644 --- a/patches/etc.apache2.sites-available.000-default.conf.patch +++ b/patches/etc.apache2.sites-available.000-default.conf.patch @@ -1,12 +1,30 @@ ---- 000-default.conf.orig 2016-03-19 09:48:35.000000000 +0000 -+++ 000-default.conf 2018-01-16 09:59:59.875227151 +0000 -@@ -26,6 +26,10 @@ +--- 000-default.conf.orig 2018-05-27 10:38:20.168898686 +0000 ++++ 000-default.conf 2018-05-27 10:40:02.113596043 +0000 +@@ -11,6 +11,16 @@ + ServerAdmin webmaster@localhost + DocumentRoot /var/www/html + ++ # Directory for letsencrypt webroot challenge. ++ ++ Alias /.well-known/acme-challenge/ "/var/www/html/.well-known/acme-challenge/" ++ ++ ++ Options None ++ AllowOverride None ++ Require all granted ++ ++ + # Available loglevels: trace8, ..., trace1, debug, info, notice, warn, + # error, crit, alert, emerg. + # It is also possible to configure the loglevel for particular +@@ -26,6 +36,11 @@ # following line enables the CGI configuration for this host only # after it has been globally disabled with "a2disconf". #Include conf-available/serve-cgi-bin.conf + + # Redirect all requests to https. + RewriteEngine on ++ RewriteCond %{REQUEST_URI} !^/.well-known/acme-challenge/* + RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,QSA,R=permanent]