From 6382785cc9468a3549db5382f6565e24fc0affad Mon Sep 17 00:00:00 2001 From: Martin Jackson Date: Tue, 24 May 2016 18:10:01 +0100 Subject: [PATCH] Add proxyrequests directive (#144) * Add ProxyRequests directive This allows or prevents Apache httpd from functioning as a forward proxy server. [See](https://httpd.apache.org/docs/current/mod/mod_proxy.html#proxyrequests). The default action is off so I've set this a the default for this formula so it does not change the default behaviour. * Add example pillar usage --- apache/vhosts/proxy.tmpl | 3 ++- pillar.example | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/apache/vhosts/proxy.tmpl b/apache/vhosts/proxy.tmpl index 5c6115c..d94f310 100644 --- a/apache/vhosts/proxy.tmpl +++ b/apache/vhosts/proxy.tmpl @@ -18,6 +18,7 @@ 'LogFormat': site.get('LogFormat', '"%h %l %u %t \\\"%r\\\" %>s %O"'), 'CustomLog': site.get('CustomLog', '{0}/{1}-access.log'.format(map.logdir, sitename)), + 'ProxyRequests': site.get('ProxyRequests', 'Off'), 'ProxyPreserveHost': site.get('ProxyPreserveHost', 'On'), 'ProxyRoute': site.get('ProxyRoute', {}), } %} @@ -44,7 +45,7 @@ SSLCertificateChainFile {{ site.SSLCertificateChainFile}} {% endif %} {% endif %} - + ProxyRequests {{ vals.ProxyRequests }} ProxyPreserveHost {{ vals.ProxyPreserveHost }} {% for proxy, proxyargs in vals.ProxyRoute|dictsort|reverse %} {% set proxyvals = { diff --git a/pillar.example b/pillar.example index 9ad1070..34ffe80 100644 --- a/pillar.example +++ b/pillar.example @@ -85,6 +85,7 @@ apache: # RedirectTarget: 'http://www.example.net' # if template is 'proxy.tmpl' + # ProxyRequests: 'On' # ProxyPreserveHost: 'On' # ProxyRoute: # my sample route: