apache: Added support for forward proxy with optional caching

This commit is contained in:
Ossi Salmi 2013-06-29 23:25:47 +03:00
parent 9d2c3104e2
commit 341c86a0a0
2 changed files with 82 additions and 18 deletions

View file

@ -1,12 +1,21 @@
<% if @apache_proxy_allow -%>
ProxyRequests On
ProxyVia On
Listen <%= @port %>
<VirtualHost _default_:<%= @port %>>
ProxyRequests On
ProxyVia On
<% if @cache == true -%>
<IfModule mod_disk_cache.c>
CacheEnable disk /
CacheRoot <%= @cachepath %>
</IfModule>
<Proxy *>
Order deny,allow
Deny from all
Allow from <%= @apache_proxy_allow %>
</Proxy>
<% else -%>
ProxyRequests Off
<% end -%>
<Proxy *>
Order deny,allow
Deny from all
<% @allow.each do |addr| -%>
Allow from <%= addr %>
<% end -%>
</Proxy>
</VirtualHost>