diff options
author | Chris Buechler <cmb@pfsense.org> | 2016-01-11 17:05:40 -0600 |
---|---|---|
committer | Chris Buechler <cmb@pfsense.org> | 2016-01-11 17:05:40 -0600 |
commit | 8f10bc95dc9151d2081fc37e55b7e8a07657de9d (patch) | |
tree | 2a4226af4ffc7b11407a720221434552fbdb21e0 | |
parent | ea46d8331b641c5f0aa6dff508befd78de0a013c (diff) | |
download | pfsense-8f10bc95dc9151d2081fc37e55b7e8a07657de9d.zip pfsense-8f10bc95dc9151d2081fc37e55b7e8a07657de9d.tar.gz |
Use case-insensitive regex matching for http_host in nginx captive portal configs.
-rw-r--r-- | src/etc/inc/system.inc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/etc/inc/system.inc b/src/etc/inc/system.inc index 1628387..d1a0dd0 100644 --- a/src/etc/inc/system.inc +++ b/src/etc/inc/system.inc @@ -1177,14 +1177,14 @@ function system_generate_nginx_config($filename, foreach ($cp_interfaces as $cpint) { $cpint_ip = get_interface_ip($cpint); if (is_ipaddr($cpint_ip)) { - $cp_hostcheck .= "\t\tif (\$http_host = $cpint_ip) {\n"; + $cp_hostcheck .= "\t\tif (\$http_host ~* $cpint_ip) {\n"; $cp_hostcheck .= "\t\t\tset \$cp_redirect no;\n"; $cp_hostcheck .= "\t\t}\n"; } } if (isset($config['captiveportal'][$captive_portal]['httpsname']) && is_domain($config['captiveportal'][$captive_portal]['httpsname'])) { - $cp_hostcheck .= "\t\tif (\$http_host = {$config['captiveportal'][$captive_portal]['httpsname']}) {\n"; + $cp_hostcheck .= "\t\tif (\$http_host ~* {$config['captiveportal'][$captive_portal]['httpsname']}) {\n"; $cp_hostcheck .= "\t\t\tset \$cp_redirect no;\n"; $cp_hostcheck .= "\t\t}\n"; } |