aboutsummaryrefslogtreecommitdiffstats
path: root/config/squid-reverse/squid_reverse.inc
diff options
context:
space:
mode:
authorgeijt <geijt50@hotmail.com>2013-02-09 17:16:29 +0100
committergeijt <geijt50@hotmail.com>2013-02-09 17:17:07 +0100
commitd1dce3495cf5fdddddb5b9ca0c1b7334b4dd29ac (patch)
treed608614e4ce44e1450948304ea3c1d04fb03386b /config/squid-reverse/squid_reverse.inc
parent44b75f44ba49e82a11a3a008e4a2123c89511b74 (diff)
downloadpfsense-packages-d1dce3495cf5fdddddb5b9ca0c1b7334b4dd29ac.tar.gz
pfsense-packages-d1dce3495cf5fdddddb5b9ca0c1b7334b4dd29ac.tar.bz2
pfsense-packages-d1dce3495cf5fdddddb5b9ca0c1b7334b4dd29ac.zip
Added redirects for squid-reverse
Added the options for squid-reverse to redirect from http/https on the specified URI to an URL
Diffstat (limited to 'config/squid-reverse/squid_reverse.inc')
-rw-r--r--config/squid-reverse/squid_reverse.inc35
1 files changed, 35 insertions, 0 deletions
diff --git a/config/squid-reverse/squid_reverse.inc b/config/squid-reverse/squid_reverse.inc
index 652931c8..eb2d4c73 100644
--- a/config/squid-reverse/squid_reverse.inc
+++ b/config/squid-reverse/squid_reverse.inc
@@ -4,6 +4,7 @@
squid_reverse.inc
Copyright (C) 2012 Martin Fuchs
Copyright (C) 2012 Marcello Coutinho
+ Copyright (C) 2013 Gekkenhuis
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -40,6 +41,8 @@ function squid_resync_reverse() {
$reverse_peers=$config['installedpackages']['squidreversepeer']['config'];
if (is_array($config['installedpackages']['squidreverseuri']))
$reverse_maps=$config['installedpackages']['squidreverseuri']['config'];
+ if (is_array($config['installedpackages']['squidreverseredir']))
+ $reverse_redir=$config['installedpackages']['squidreverseredir']['config'];
$conf = "# Reverse Proxy settings\n";
@@ -124,6 +127,38 @@ function squid_resync_reverse() {
}
}
+ //REDIRECTS
+ if (is_array($reverse_redir)) {
+ foreach ($reverse_redir as $rdr) {
+ if($rdr['enable'] == "on" && $rdr['name'] != "" && $rdr['pathregex'] != "" && $rdr['redirurl'] != "") {
+ $conf_rdr = "# Redirect: {$rdr['description']}\n";
+
+ if (is_array($rdr['row'])) {
+ foreach ($rdr['row'] as $uri) {
+ $conf_rdr .= "acl rdr_dst_{$rdr['name']} dstdomain {$uri['uri']}\n";
+ }
+ }
+
+ $conf_rdr .= "acl rdr_path_{$rdr['name']} urlpath_regex {$rdr['pathregex']}\n";
+ $conf_rdr .= "deny_info {$rdr['redirurl']} rdr_path_{$rdr['name']}\n";
+
+ foreach (explode(',', $rdr['protocol']) as $rdr_protocol) {
+ if($rdr_protocol == "HTTP") {
+ $conf_rdr .= "http_access deny HTTP rdr_dst_{$rdr['name']} rdr_path_{$rdr['name']}\n";
+ }
+
+ if($rdr_protocol == "HTTPS") {
+ $conf_rdr .= "http_access deny HTTPS rdr_dst_{$rdr['name']} rdr_path_{$rdr['name']}\n";
+ }
+ }
+
+ $conf_rdr .= "\n";
+ }
+
+ $conf .= $conf_rdr;
+ }
+ }
+
//ACLS and MAPPINGS
//create an empty owa_dirs to populate based on user selected options