diff options
author | mh <mh@immerda.ch> | 2010-11-01 19:07:39 +0100 |
---|---|---|
committer | mh <mh@immerda.ch> | 2010-11-01 19:07:39 +0100 |
commit | 4b3a940b7396fcc7f0412eecf524c96580fa953b (patch) | |
tree | 3cd75e1abf25651a11942376d394cb1e27a8ce55 /templates/vhosts/proxy | |
parent | 6a9fd8470b18c8b9b16f7b517004a09cbf9c9247 (diff) |
add possibility to proxy vhosts
Diffstat (limited to 'templates/vhosts/proxy')
l--------- | templates/vhosts/proxy/CentOS.erb | 1 | ||||
l--------- | templates/vhosts/proxy/Debian.erb | 1 | ||||
l--------- | templates/vhosts/proxy/OpenBSD.erb | 1 | ||||
-rw-r--r-- | templates/vhosts/proxy/proxy.erb | 78 |
4 files changed, 81 insertions, 0 deletions
diff --git a/templates/vhosts/proxy/CentOS.erb b/templates/vhosts/proxy/CentOS.erb new file mode 120000 index 0000000..15a1b7c --- /dev/null +++ b/templates/vhosts/proxy/CentOS.erb @@ -0,0 +1 @@ +proxy.erb
\ No newline at end of file diff --git a/templates/vhosts/proxy/Debian.erb b/templates/vhosts/proxy/Debian.erb new file mode 120000 index 0000000..15a1b7c --- /dev/null +++ b/templates/vhosts/proxy/Debian.erb @@ -0,0 +1 @@ +proxy.erb
\ No newline at end of file diff --git a/templates/vhosts/proxy/OpenBSD.erb b/templates/vhosts/proxy/OpenBSD.erb new file mode 120000 index 0000000..15a1b7c --- /dev/null +++ b/templates/vhosts/proxy/OpenBSD.erb @@ -0,0 +1 @@ +proxy.erb
\ No newline at end of file diff --git a/templates/vhosts/proxy/proxy.erb b/templates/vhosts/proxy/proxy.erb new file mode 100644 index 0000000..5d94e69 --- /dev/null +++ b/templates/vhosts/proxy/proxy.erb @@ -0,0 +1,78 @@ +# <%= servername %> +<%- unless ssl_mode.to_s == 'only' then -%> +<VirtualHost *:80> + Include include.d/defaults.inc + ServerName <%= servername %> + <%- unless serveralias.to_s.empty? then -%> + ServerAlias <%= serveralias %> + <%- end -%> + <%- unless server_admin.to_s.empty? or server_admin.to_s == 'absent' then -%> + ServerAdmin <%= server_admin %> + <%- end -%> + + <%- case logmode.to_s + when 'nologs' -%> + ErrorLog /dev/null + CustomLog /dev/null + <%- when 'semianonym' -%> + ErrorLog <%= logdir %>/error_log + CustomLog <%= logdir %>/access_log noip + <%- when 'anonym' -%> + ErrorLog /dev/null + CustomLog <%= logdir %>/access_log noip + <%- else -%> + ErrorLog <%= logdir %>/error_log + CustomLog <%= logdir %>/access_log combined + <%- end -%> + <%- if ssl_mode.to_s == 'force' then -%> + RewriteEngine On + RewriteCond %{HTTPS} !=on + RewriteRule (.*) https://%{SERVER_NAME}$1 [R=permanent,L] + <% else -%> + <Proxy *> + Order deny,allow + Allow from all + </Proxy> + ProxyRequests Off + ProxyPass / <%= options %>/ + ProxyPassReverse / <%= options %>/ + <%- end -%> +</VirtualHost> +<%- end -%> + +<%- unless ssl_mode.to_s == 'false' then -%> +<VirtualHost *:443> + Include include.d/defaults.inc + Include include.d/ssl_defaults.inc + ServerName <%= servername %> + <%- unless serveralias.to_s.empty? then -%> + ServerAlias <%= serveralias %> + <%- end -%> + <%- unless server_admin.to_s.empty? or server_admin.to_s == 'absent' then -%> + ServerAdmin <%= server_admin %> + <%- end -%> + + <%- case logmode.to_s + when 'nologs' -%> + ErrorLog /dev/null + CustomLog /dev/null + <%- when 'semianonym' -%> + ErrorLog <%= logdir %>/error_log + CustomLog <%= logdir %>/access_log noip + <%- when 'anonym' -%> + ErrorLog /dev/null + CustomLog <%= logdir %>/access_log noip + <%- else -%> + ErrorLog <%= logdir %>/error_log + CustomLog <%= logdir %>/access_log combined + <%- end -%> + + <Proxy *> + Order deny,allow + Allow from all + </Proxy> + ProxyRequests Off + ProxyPass / <%= options %>/ + ProxyPassReverse / <%= options %>/ +</VirtualHost> +<%- end -%> |