diff --git a/actions/admin/settings/130.webserver.php b/actions/admin/settings/130.webserver.php
index 88116a22..61695f40 100644
--- a/actions/admin/settings/130.webserver.php
+++ b/actions/admin/settings/130.webserver.php
@@ -147,6 +147,15 @@ return array(
'save_method' => 'storeSettingField',
'websrv_avail' => array('nginx')
),
+ 'nginx_fastcgiparams' => array(
+ 'label' => $lng['serversettings']['nginx_fastcgiparams'],
+ 'settinggroup' => 'nginx',
+ 'varname' => 'fastcgiparams',
+ 'type' => 'string',
+ 'default' => '/etc/nginx/fastcgi_params',
+ 'save_method' => 'storeSettingField',
+ 'websrv_avail' => array('nginx')
+ ),
'system_mod_log_sql' => array(
'label' => $lng['serversettings']['mod_log_sql'],
'settinggroup' => 'system',
diff --git a/install/froxlor.sql b/install/froxlor.sql
index 068b5272..b76535a0 100644
--- a/install/froxlor.sql
+++ b/install/froxlor.sql
@@ -414,6 +414,7 @@ INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES
('phpfpm', 'vhost_httpgroup', 'froxlorlocal'),
('phpfpm', 'idle_timeout', '30'),
('phpfpm', 'aliasconfigdir', '/var/www/php-fpm/'),
+ ('nginx', 'fastcgiparams', '/etc/nginx/fastcgi_params'),
('system', 'lastaccountnumber', '0'),
('system', 'lastguid', '9999'),
('system', 'documentroot_prefix', '/var/customers/webs/'),
diff --git a/install/updates/froxlor/0.9/update_0.9.inc.php b/install/updates/froxlor/0.9/update_0.9.inc.php
index 1d2bd6ac..2015ca15 100644
--- a/install/updates/froxlor/0.9/update_0.9.inc.php
+++ b/install/updates/froxlor/0.9/update_0.9.inc.php
@@ -2003,10 +2003,18 @@ if(isFroxlorVersion('0.9.28-svn5')) {
$db->query("UPDATE `panel_admins` SET `tickets_see_all` = '1' WHERE `adminid` = '".$userinfo['adminid']."';");
lastStepStatus(0);
- showUpdateSet("Inserting new webfont-settings", true);
+ showUpdateStep("Inserting new webfont-settings", true);
$db->query("INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES ('panel', 'use_webfonts', '1');");
$db->query("INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES ('panel', 'webfont', 'Numans');");
lastStepStatus(0);
+ showUpdateStep("Inserting settings for nginx fastcgi-params file", true);
+ $fastcgiparams = '/etc/nginx/fastcgi_params';
+ if (isset($_POST['nginx_fastcgi_params']) && $_POST['nginx_fastcgi_params'] != '') {
+ $fastcgiparams = makeCorrectDir($_POST['nginx_fastcgi_params']);
+ }
+ $db->query("INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES ('nginx', 'fastcgiparams', '".$db->escape($fastcgiparams)."')");
+ lastStepStatus(0);
+
updateToVersion('0.9.28-svn6');
}
diff --git a/install/updates/preconfig/0.9/preconfig_0.9.inc.php b/install/updates/preconfig/0.9/preconfig_0.9.inc.php
index 73935efd..e4ffd48d 100644
--- a/install/updates/preconfig/0.9/preconfig_0.9.inc.php
+++ b/install/updates/preconfig/0.9/preconfig_0.9.inc.php
@@ -453,12 +453,21 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version)
}
if (versionInUpdate($current_version, '0.9.28-svn6')) {
- $has_preconfig = true;
- $description = 'Froxlor now supports the new Apache 2.4. Please be aware that you need to load additional apache-modules in ordner to use it. ';
- $description.= '
LoadModule authz_core_module modules/mod_authz_core.so LoadModule authz_host_module modules/mod_authz_host.so ';
- $question = 'Do you want to enable the Apache-2.4 modification?: ';
- $question.= makeyesno('update_system_apache24', '1', '0', '0');
-
- eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
+
+ if ($settings['system']['webserver'] == 'apache2') {
+ $has_preconfig = true;
+ $description = 'Froxlor now supports the new Apache 2.4. Please be aware that you need to load additional apache-modules in ordner to use it. ';
+ $description.= 'LoadModule authz_core_module modules/mod_authz_core.so LoadModule authz_host_module modules/mod_authz_host.so ';
+ $question = 'Do you want to enable the Apache-2.4 modification?: ';
+ $question.= makeyesno('update_system_apache24', '1', '0', '0');
+ eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
+ } elseif ($settings['system']['webserver'] == 'nginx') {
+ $has_preconfig = true;
+ $description = 'The path to nginx\'s fastcgi_params file is now customizable. ';
+ $question = 'Please enter full path to you nginx/fastcgi_params file (including filename): ';
+ $question.= ' ';
+ eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
+ }
}
+
}
diff --git a/lng/english.lng.php b/lng/english.lng.php
index 59218e7b..e7e6ebc7 100644
--- a/lng/english.lng.php
+++ b/lng/english.lng.php
@@ -1930,3 +1930,5 @@ $lng['serversettings']['catchall_enabled']['description'] = 'Do you want to pro
// ADDED IN 0.9.28.svn6
$lng['serversettings']['apache_24'] = 'Use modifications for Apache 2.4';
$lng['admin']['tickets_see_all'] = 'Can see all ticket-categories?';
+$lng['serversettings']['nginx_fastcgiparams']['title'] = 'Path to fastcgi_params file';
+$lng['serversettings']['nginx_fastcgiparams']['description'] = 'Specify the path to nginx\'s fastcgi_params file including filename';
diff --git a/lng/german.lng.php b/lng/german.lng.php
index 4cb063ee..9c272ac4 100644
--- a/lng/german.lng.php
+++ b/lng/german.lng.php
@@ -1655,3 +1655,5 @@ $lng['serversettings']['catchall_enabled']['description'] = 'Möchten Sie Ihren
// ADDED IN 0.9.28.svn6
$lng['serversettings']['apache_24'] = 'Anpassungen für Apache 2.4 verwenden';
$lng['admin']['tickets_see_all'] = 'Kann alle Ticket-Kategorien sehen?';
+$lng['serversettings']['nginx_fastcgiparams']['title'] = 'Pfad zur fastcgi_params Datei';
+$lng['serversettings']['nginx_fastcgiparams']['description'] = 'Geben Sie den Pfad zu nginx\'s fastcgi_params Datei an. Inlkusive Dateiname!';
diff --git a/scripts/jobs/cron_tasks.inc.http.30.nginx.php b/scripts/jobs/cron_tasks.inc.http.30.nginx.php
index 17a7c9ee..6a232460 100644
--- a/scripts/jobs/cron_tasks.inc.http.30.nginx.php
+++ b/scripts/jobs/cron_tasks.inc.http.30.nginx.php
@@ -232,8 +232,11 @@ class nginx
}
$this->nginx_data[$vhost_filename].= "\t".'location ~ \.php$ {'."\n";
+ $this->nginx_data[$vhost_filename].= "\t\t".' if (!-f $request_filename) {'."\n";
+ $this->nginx_data[$vhost_filename].= "\t\t\t".'return 404;'."\n";
+ $this->nginx_data[$vhost_filename].= "\t\t".'}'."\n";
$this->nginx_data[$vhost_filename].= "\t\t".'fastcgi_index index.php;'."\n";
- $this->nginx_data[$vhost_filename].= "\t\t".'include /etc/nginx/fastcgi_params;'."\n";
+ $this->nginx_data[$vhost_filename].= "\t\t".'include '.$this->settings['nginx']['fastcgiparams'].';'."\n";
$this->nginx_data[$vhost_filename].= "\t\t".'fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;'."\n";
if ($row_ipsandports['ssl'] == '1') {
$this->nginx_data[$vhost_filename].= "\t\t".'fastcgi_param HTTPS on;'."\n";
@@ -545,7 +548,7 @@ class nginx
$path_options.= "\t\t" . 'gzip off; #gzip makes scripts feel slower since they have to complete before getting gzipped' . "\n";
$path_options.= "\t\t" . 'fastcgi_pass '. $this->settings['system']['perl_server'] . ';' . "\n";
$path_options.= "\t\t" . 'fastcgi_index index.cgi;' . "\n";
- $path_options.= "\t\t" . 'include /etc/nginx/fastcgi_params;'."\n";
+ $path_options.= "\t\t" . 'include '.$this->settings['nginx']['fastcgiparams'].';'."\n";
$path_options.= "\t" . '}' . "\n";
}
@@ -625,7 +628,7 @@ class nginx
$phpopts.= "\t\t".'fastcgi_index index.php;'."\n";
$phpopts.= "\t\t".'fastcgi_pass ' . $this->settings['system']['nginx_php_backend'] . ';' . "\n";
$phpopts.= "\t\t".'fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;'."\n";
- $phpopts.= "\t\t".'include /etc/nginx/fastcgi_params;'."\n";
+ $phpopts.= "\t\t".'include '.$this->settings['nginx']['fastcgiparams'].';'."\n";
if ($domain['ssl'] == '1' && $ssl_vhost) {
$phpopts.= "\t\t".'fastcgi_param HTTPS on;'."\n";
}
diff --git a/scripts/jobs/cron_tasks.inc.http.35.nginx_phpfpm.php b/scripts/jobs/cron_tasks.inc.http.35.nginx_phpfpm.php
index e9cdfadb..f7587679 100644
--- a/scripts/jobs/cron_tasks.inc.http.35.nginx_phpfpm.php
+++ b/scripts/jobs/cron_tasks.inc.http.35.nginx_phpfpm.php
@@ -43,7 +43,7 @@ class nginx_phpfpm extends nginx
$php_options_text.= "\t\t".'fastcgi_pass unix:' . $php->getInterface()->getSocketFile() . ';' . "\n";
$php_options_text.= "\t\t".'fastcgi_index index.php;'."\n";
$php_options_text.= "\t\t".'fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;'."\n";
- $php_options_text.= "\t\t".'include /etc/nginx/fastcgi_params;'."\n";
+ $php_options_text.= "\t\t".'include '.$this->settings['nginx']['fastcgiparams'].';'."\n";
if ($domain['ssl'] == '1' && $ssl_vhost) {
$php_options_text.= "\t\t".'fastcgi_param HTTPS on;'."\n";
}