Removing evil if from nginx vhosts

Signed-off-by: Roman Schmerold <bnoize@froxlor.org>
This commit is contained in:
Roman Schmerold
2014-10-11 07:58:01 +02:00
parent bc8e56e7da
commit 539ec529c2
2 changed files with 2 additions and 6 deletions

View File

@@ -203,9 +203,7 @@ class nginx {
$this->nginx_data[$vhost_filename] .= "\t\tinclude ".Settings::Get('nginx.fastcgiparams').";\n"; $this->nginx_data[$vhost_filename] .= "\t\tinclude ".Settings::Get('nginx.fastcgiparams').";\n";
$this->nginx_data[$vhost_filename] .= "\t\tfastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n"; $this->nginx_data[$vhost_filename] .= "\t\tfastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n";
$this->nginx_data[$vhost_filename] .= "\t\tfastcgi_param PATH_INFO \$fastcgi_path_info;\n"; $this->nginx_data[$vhost_filename] .= "\t\tfastcgi_param PATH_INFO \$fastcgi_path_info;\n";
$this->nginx_data[$vhost_filename] .= "\t\tif (!-e \$document_root\$fastcgi_script_name) {\n"; $this->nginx_data[$vhost_filename] .= "\t\ttry_files \$fastcgi_script_name =404;\n";
$this->nginx_data[$vhost_filename] .= "\t\t\treturn 404;\n";
$this->nginx_data[$vhost_filename] .= "\t\t}\n";
if ($row_ipsandports['ssl'] == '1') { if ($row_ipsandports['ssl'] == '1') {
$this->nginx_data[$vhost_filename] .= "\t\tfastcgi_param HTTPS on;\n"; $this->nginx_data[$vhost_filename] .= "\t\tfastcgi_param HTTPS on;\n";

View File

@@ -29,9 +29,7 @@ class nginx_phpfpm extends nginx
$php_options_text .= "\t\tinclude ".Settings::Get('nginx.fastcgiparams').";\n"; $php_options_text .= "\t\tinclude ".Settings::Get('nginx.fastcgiparams').";\n";
$php_options_text .= "\t\tfastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n"; $php_options_text .= "\t\tfastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n";
$php_options_text .= "\t\tfastcgi_param PATH_INFO \$fastcgi_path_info;\n"; $php_options_text .= "\t\tfastcgi_param PATH_INFO \$fastcgi_path_info;\n";
$php_options_text .= "\t\tif (!-e \$document_root\$fastcgi_script_name) {\n"; $php_options_text .= "\t\ttry_files \$fastcgi_script_name =404;\n";
$php_options_text .= "\t\t\treturn 404;\n";
$php_options_text .= "\t\t}\n";
$php_options_text .= "\t\tfastcgi_pass unix:".$php->getInterface()->getSocketFile().";\n"; $php_options_text .= "\t\tfastcgi_pass unix:".$php->getInterface()->getSocketFile().";\n";
$php_options_text .= "\t\tfastcgi_index index.php;\n"; $php_options_text .= "\t\tfastcgi_index index.php;\n";
if ($domain['ssl'] == '1' && $ssl_vhost) { if ($domain['ssl'] == '1' && $ssl_vhost) {