]> gitweb.fluxo.info Git - puppet-apache.git/commitdiff
Use $apache_https_proxy instead of hardcoded HTTPS setting
authorSilvio Rhatto <rhatto@riseup.net>
Fri, 18 Nov 2011 19:48:49 +0000 (17:48 -0200)
committerSilvio Rhatto <rhatto@riseup.net>
Fri, 18 Nov 2011 19:48:49 +0000 (17:48 -0200)
manifests/init.pp
templates/apache2.conf.erb

index 42917b978e337f93d372dfda04dc5c93ea730c89..3d57fa31e985f11e882bc290bdb942c0e0f3b117 100644 (file)
@@ -26,6 +26,7 @@
 
 $apache2_sites  = "/etc/apache2/sites"
 $apache2_mods   = "/etc/apache2/mods"
+$apache2_conf_d = "/etc/apache2/conf.d"
 $apache2_macros = "/etc/apache2/conf.d/macros"
 $apache2_conf   = "/etc/apache2/apache2.conf"
 
@@ -114,6 +115,23 @@ class apache {
     notify  => Service["apache"],
   }
 
+  # https proxy configuration
+  # see http://www.metaltoad.com/blog/running-drupal-secure-pages-behind-proxy
+  file { "$apache2_conf_d/https-proxy":
+    ensure => $apache_https_proxy ? {
+      ''      => absent,
+      default => present,
+    }
+    content => $apache_https_proxy ? {
+      'force' => "SetEnv HTTPS on\n",
+      default => "SetEnvIf X-Forwarded-Proto https HTTPS=on\n",
+    },
+    owner   => root,
+    group   => root,
+    mode    => 0644,
+    notify  => Service["apache"],
+  }
+
   define site($ensure = present, $docroot = false, $redirect = false,
               $redirect_match = false, $protocol = 'http', $aliases = false,
               $server_alias = false, $use = false, $ticket = false,
index 9b6132f605a8c17f8f35876204a6f535623b8dd5..ee28bdc47ce3c9288daad2593b2f2ba5061b67f4 100644 (file)
@@ -644,6 +644,3 @@ ErrorDocument 404 http://<%= domain %>/missing.html
 
 # Include the virtual host configurations:
 Include /etc/apache2/sites-enabled/
-
-# See http://www.metaltoad.com/blog/running-drupal-secure-pages-behind-proxy
-SetEnvIf X-Forwarded-Proto https HTTPS=on