diff options
author | Márcio Carlos <marcioc.antao@gmail.com> | 2013-11-13 15:29:10 -0200 |
---|---|---|
committer | Márcio Carlos <marcioc.antao@gmail.com> | 2013-11-13 15:29:10 -0200 |
commit | f5d93c52d18de995a4f1c996a5113041395e3bf3 (patch) | |
tree | 51c4619b496065a68cb2b15caf9e42f4ada7caff /config | |
parent | f6dfaf4f9727882055454927da41916f444b9e15 (diff) | |
download | pfsense-packages-f5d93c52d18de995a4f1c996a5113041395e3bf3.tar.gz pfsense-packages-f5d93c52d18de995a4f1c996a5113041395e3bf3.tar.bz2 pfsense-packages-f5d93c52d18de995a4f1c996a5113041395e3bf3.zip |
Update apache_mod_security.inc
If Backend not set(none in XML)its not include in virtualhost.conf
Diffstat (limited to 'config')
-rw-r--r-- | config/apache_mod_security-dev/apache_mod_security.inc | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/config/apache_mod_security-dev/apache_mod_security.inc b/config/apache_mod_security-dev/apache_mod_security.inc index c9ab05e8..1cb6afd4 100644 --- a/config/apache_mod_security-dev/apache_mod_security.inc +++ b/config/apache_mod_security-dev/apache_mod_security.inc @@ -582,26 +582,28 @@ EOF; #Check virtualhost locations foreach ($virtualhost['row'] as $backend){ - $vh_config.=" <Location ".($backend['sitepath'] ? $backend['sitepath'] : "/").">\n"; - $vh_config.=" ProxyPass balancer://{$backend['balancer']}{$backend['backendpath']}\n"; - $vh_config.=" ProxyPassReverse balancer://{$backend['balancer']}{$backend['backendpath']}\n"; - if ($backend['compress']== "no") - $vh_config.=" SetInputFilter INFLATE\n SetOutputFilter INFLATE\n"; - if ($backend['modsecgroup']!="" && $backend['modsecgroup']!="none" && $mods_settings['enablemodsecurity']=="on"){ - $vh_config.=$mods_group[$backend['modsecgroup']]; - } - if (is_array($config['installedpackages']['apachemodsecuritymanipulation']) && $mods_settings['enablemodsecurity']=="on"){ - foreach($config['installedpackages']['apachemodsecuritymanipulation']['config'] as $manipulation){ - if ($backend['modsecmanipulation'] == $manipulation['name']){ - if (is_array($manipulation['row'])) - foreach ($manipulation['row'] as $secrule) - $vh_config.=" {$secrule['type']} {$secrule['value']}\n"; + if ($backend['balancer'] != "none"){ + $vh_config.=" <Location ".($backend['sitepath'] ? $backend['sitepath'] : "/").">\n"; + $vh_config.=" ProxyPass balancer://{$backend['balancer']}{$backend['backendpath']}\n"; + $vh_config.=" ProxyPassReverse balancer://{$backend['balancer']}{$backend['backendpath']}\n"; + if ($backend['compress']== "no") + $vh_config.=" SetInputFilter INFLATE\n SetOutputFilter INFLATE\n"; + if ($backend['modsecgroup']!="" && $backend['modsecgroup']!="none" && $mods_settings['enablemodsecurity']=="on"){ + $vh_config.=$mods_group[$backend['modsecgroup']]; + } + if (is_array($config['installedpackages']['apachemodsecuritymanipulation']) && $mods_settings['enablemodsecurity']=="on"){ + foreach($config['installedpackages']['apachemodsecuritymanipulation']['config'] as $manipulation){ + if ($backend['modsecmanipulation'] == $manipulation['name']){ + if (is_array($manipulation['row'])) + foreach ($manipulation['row'] as $secrule) + $vh_config.=" {$secrule['type']} {$secrule['value']}\n"; + } } } - } - $vh_config.= apache_textarea_decode($backend['custom'])."\n\n"; - $vh_config.=" </Location>\n\n"; + $vh_config.= apache_textarea_decode($backend['custom'])."\n\n"; + $vh_config.=" </Location>\n\n"; } + } $vh_config.="</VirtualHost>\n"; } } |