summaryrefslogtreecommitdiffstats
path: root/src/etc/inc/system.inc
diff options
context:
space:
mode:
authorChris Buechler <cmb@pfsense.org>2016-01-04 20:47:58 -0600
committerRenato Botelho <renato@netgate.com>2016-01-05 09:08:10 -0200
commite90d9933a7842e3e3fbbfb0993441c70074796ec (patch)
treec940dc2b899f550d9296e1d8a8698696d10370e3 /src/etc/inc/system.inc
parent257fdefe7cc43bb9204f068f5caa1196602f8374 (diff)
downloadpfsense-e90d9933a7842e3e3fbbfb0993441c70074796ec.zip
pfsense-e90d9933a7842e3e3fbbfb0993441c70074796ec.tar.gz
some CP clean up in nginx start
Diffstat (limited to 'src/etc/inc/system.inc')
-rw-r--r--src/etc/inc/system.inc56
1 files changed, 3 insertions, 53 deletions
diff --git a/src/etc/inc/system.inc b/src/etc/inc/system.inc
index 691eff3..d7e7182 100644
--- a/src/etc/inc/system.inc
+++ b/src/etc/inc/system.inc
@@ -1170,29 +1170,16 @@ function system_generate_nginx_config($filename,
}
if ($captive_portal !== false) {
- $captiveportal = ",\"mod_rewrite\",\"mod_evasive\"";
$captive_portal_rewrite = "url.rewrite-once = ( \"(.*captiveportal.*)\" => \"$1\", \"(.*)\" => \"/index.php?zone={$captive_portal}&redirurl=$1\" )\n";
$maxprocperip = $config['captiveportal'][$captive_portal]['maxprocperip'];
if (empty($maxprocperip)) {
$maxprocperip = 10;
}
- $captive_portal_mod_evasive = "evasive.max-conns-per-ip = {$maxprocperip}";
+ $captive_portal_maxprocperip = "limit_conn_zone \$binary_remote_addr zone=addr:10m;\n";
+ $captive_portal_maxprocperip .= "limit_conn addr $maxprocperip\n";
- $server_upload_dirs = "server.upload-dirs = ( \"{$g['tmp_path']}/captiveportal/\" )\n";
- if (!is_dir("{$g['tmp_path']}/captiveportal")) {
- @mkdir("{$g['tmp_path']}/captiveportal", 0555);
- }
- $server_max_request_size = "server.max-request-size = 384";
- $cgi_config = "";
- } else {
- $captiveportal = ",\"mod_cgi\"";
- $captive_portal_rewrite = "";
- $captive_portal_mod_evasive = "";
- $server_upload_dirs = "server.upload-dirs = ( \"{$g['upload_path']}/\", \"{$g['tmp_path']}/\", \"/var/\" )\n";
- $server_max_request_size = "server.max-request-size = 2097152";
- $cgi_config = "cgi.assign = ( \".cgi\" => \"\" )";
- }
+ }
if (empty($port)) {
$nginx_port = "80";
@@ -1233,43 +1220,6 @@ function system_generate_nginx_config($filename,
}
}
- if ($captive_portal !== false) {
- $fast_cgi_path = "{$g['tmp_path']}/php-fastcgi-{$captive_portal}.socket";
- $fastcgi_config = <<<EOD
-#### fastcgi module
-## read fastcgi.txt for more info
-fastcgi.server = ( ".php" =>
- ( "localhost" =>
- (
- "socket" => "{$fast_cgi_path}",
- "max-procs" => {$max_procs},
- "bin-environment" => (
- "PHP_FCGI_CHILDREN" => "{$max_php_children}",
- "PHP_FCGI_MAX_REQUESTS" => "500"
- ),
- "bin-path" => "/usr/local/bin/php-cgi"
- )
- )
-)
-
-EOD;
- } else {
- $fast_cgi_path = "{$g['varrun_path']}/php-fpm.socket";
- $fastcgi_config = <<<EOD
-#### fastcgi module
-## read fastcgi.txt for more info
-fastcgi.server = ( ".php" =>
- ( "localhost" =>
- (
- "socket" => "{$fast_cgi_path}",
- "broken-scriptfilename" => "enable"
- )
- )
-)
-
-EOD;
- }
-
$nginx_config = <<<EOD
#
# nginx configuration file
OpenPOWER on IntegriCloud