diff options
author | Michael Scherer <misc@mageia.org> | 2011-01-13 18:12:29 +0000 |
---|---|---|
committer | Michael Scherer <misc@mageia.org> | 2011-01-13 18:12:29 +0000 |
commit | 4d79949ce968bfef4b699d67ad2b647afcbe3c8f (patch) | |
tree | 6578a145eb403f537f306ebd144c511a2c1d86d9 /modules | |
parent | ed5b011b1cfd7b49b6dab4279f3e4386423d17bf (diff) | |
download | puppet-4d79949ce968bfef4b699d67ad2b647afcbe3c8f.tar puppet-4d79949ce968bfef4b699d67ad2b647afcbe3c8f.tar.gz puppet-4d79949ce968bfef4b699d67ad2b647afcbe3c8f.tar.bz2 puppet-4d79949ce968bfef4b699d67ad2b647afcbe3c8f.tar.xz puppet-4d79949ce968bfef4b699d67ad2b647afcbe3c8f.zip |
add a reverse proxy class
Diffstat (limited to 'modules')
-rw-r--r-- | modules/apache/manifests/init.pp | 19 | ||||
-rw-r--r-- | modules/apache/templates/vhost_reverse_proxy.conf | 22 |
2 files changed, 41 insertions, 0 deletions
diff --git a/modules/apache/manifests/init.pp b/modules/apache/manifests/init.pp index c98e2234..03eee275 100644 --- a/modules/apache/manifests/init.pp +++ b/modules/apache/manifests/init.pp @@ -80,6 +80,12 @@ class apache { mode => 644, } } + + class mod_proxy inherits base { + package { "apache-mod_proxy": + ensure => installed + } + } define vhost_redirect_ssl() { file { "redirect_ssl_$name.conf": @@ -177,6 +183,19 @@ class apache { } } + define vhost_reverse_proxy($url) { + include apache::mod_proxy + file { "$name.conf": + path => "/etc/httpd/conf/vhosts.d/$name.conf", + ensure => "present", + owner => root, + group => root, + mode => 644, + notify => Service['apache'], + content => template("apache/vhost_reverse_proxy.conf") + } + } + define webapp_other($webapp_file) { include apache::base $webappname = $name diff --git a/modules/apache/templates/vhost_reverse_proxy.conf b/modules/apache/templates/vhost_reverse_proxy.conf new file mode 100644 index 00000000..24c2d12b --- /dev/null +++ b/modules/apache/templates/vhost_reverse_proxy.conf @@ -0,0 +1,22 @@ +<VirtualHost *:80> + ServerName <%= name %> + # Serve static content directly + DocumentRoot /dev/null + + + + ProxyRequests Off + + <Proxy *> + Order deny,allow + Allow from all + </Proxy> + + ProxyPass / <%= url %> + ProxyPassReverse / <%= url %> + + <Location /> + Allow from all + </Location> +</VirtualHost> + |