apache: Added support for forward proxy with optional caching
This commit is contained in:
parent
9d2c3104e2
commit
341c86a0a0
2 changed files with 82 additions and 18 deletions
|
@ -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>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue