Skip to content

Commit 9443ee2

Browse files
committed
Add rewrite condition.
modified: patches/etc.apache2.sites-available.000-default.conf.patch
1 parent 621cf04 commit 9443ee2

File tree

1 file changed

+21
-3
lines changed

1 file changed

+21
-3
lines changed

patches/etc.apache2.sites-available.000-default.conf.patch

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,30 @@
1-
--- 000-default.conf.orig 2016-03-19 09:48:35.000000000 +0000
2-
+++ 000-default.conf 2018-01-16 09:59:59.875227151 +0000
3-
@@ -26,6 +26,10 @@
1+
--- 000-default.conf.orig 2018-05-27 10:38:20.168898686 +0000
2+
+++ 000-default.conf 2018-05-27 10:40:02.113596043 +0000
3+
@@ -11,6 +11,16 @@
4+
ServerAdmin webmaster@localhost
5+
DocumentRoot /var/www/html
6+
7+
+ # Directory for letsencrypt webroot challenge.
8+
+
9+
+ Alias /.well-known/acme-challenge/ "/var/www/html/.well-known/acme-challenge/"
10+
+
11+
+ <Directory "/var/www/html/.well-known/acme-challenge/">
12+
+ Options None
13+
+ AllowOverride None
14+
+ Require all granted
15+
+ </Directory>
16+
+
17+
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
18+
# error, crit, alert, emerg.
19+
# It is also possible to configure the loglevel for particular
20+
@@ -26,6 +36,11 @@
421
# following line enables the CGI configuration for this host only
522
# after it has been globally disabled with "a2disconf".
623
#Include conf-available/serve-cgi-bin.conf
724
+
825
+ # Redirect all requests to https.
926
+ RewriteEngine on
27+
+ RewriteCond %{REQUEST_URI} !^/.well-known/acme-challenge/*
1028
+ RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,QSA,R=permanent]
1129
</VirtualHost>
1230

0 commit comments

Comments
 (0)