Skip to content

Commit

Permalink
Added sample patches for SSL and SAML. (#602)
Browse files Browse the repository at this point in the history
  • Loading branch information
danepowell authored and grasmash committed Oct 26, 2016
1 parent 6427b28 commit 1a9b3d1
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
13 changes: 13 additions & 0 deletions template/patches/htaccess-simplesaml.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/.htaccess b/.htaccess
index 4716fa1..93f9ab6 100644
--- a/.htaccess
+++ b/.htaccess
@@ -150,6 +150,8 @@ AddEncoding gzip svgz
# Copy and adapt this rule to directly execute PHP files in contributed or
# custom modules or to run another PHP application in the same directory.
RewriteCond %{REQUEST_URI} !/core/modules/statistics/statistics.php$
+ # Allow access to simplesaml paths
+ RewriteCond %{REQUEST_URI} !^/simplesaml
# Deny access to any other PHP files that do not match the rules above.
# Specifically, disallow autoload.php from being served directly.
RewriteRule "^(.+/.*|autoload)\.php($|/)" - [F]
17 changes: 17 additions & 0 deletions template/patches/htaccess-ssl.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
diff --git a/.htaccess b/.htaccess
index 4716fa1..14014ce 100644
--- a/.htaccess
+++ b/.htaccess
@@ -122,6 +122,12 @@ AddEncoding gzip svgz
# uncomment the following line:
# RewriteBase /

+ # Redirect HTTP to HTTPS on cloud
+ RewriteCond %{ENV:AH_SITE_ENVIRONMENT} !^$
+ RewriteCond %{HTTPS} off
+ RewriteCond %{HTTP:X-Forwarded-Proto} !https
+ RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
+
# Redirect common PHP files to their new locations.
RewriteCond %{REQUEST_URI} ^(.*)?/(install.php) [OR]
RewriteCond %{REQUEST_URI} ^(.*)?/(rebuild.php)

0 comments on commit 1a9b3d1

Please sign in to comment.