From 539ec529c2ac4f7180751f99166d4f29e7f9734b Mon Sep 17 00:00:00 2001 From: Roman Schmerold Date: Sat, 11 Oct 2014 07:58:01 +0200 Subject: [PATCH] Removing evil if from nginx vhosts Signed-off-by: Roman Schmerold --- scripts/jobs/cron_tasks.inc.http.30.nginx.php | 4 +--- scripts/jobs/cron_tasks.inc.http.35.nginx_phpfpm.php | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/scripts/jobs/cron_tasks.inc.http.30.nginx.php b/scripts/jobs/cron_tasks.inc.http.30.nginx.php index 9ccd0d2d..607d30b9 100644 --- a/scripts/jobs/cron_tasks.inc.http.30.nginx.php +++ b/scripts/jobs/cron_tasks.inc.http.30.nginx.php @@ -203,9 +203,7 @@ class nginx { $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 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\t\treturn 404;\n"; - $this->nginx_data[$vhost_filename] .= "\t\t}\n"; + $this->nginx_data[$vhost_filename] .= "\t\ttry_files \$fastcgi_script_name =404;\n"; if ($row_ipsandports['ssl'] == '1') { $this->nginx_data[$vhost_filename] .= "\t\tfastcgi_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 be150dae..9ba13d72 100644 --- a/scripts/jobs/cron_tasks.inc.http.35.nginx_phpfpm.php +++ b/scripts/jobs/cron_tasks.inc.http.35.nginx_phpfpm.php @@ -29,9 +29,7 @@ class nginx_phpfpm extends nginx $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 PATH_INFO \$fastcgi_path_info;\n"; - $php_options_text .= "\t\tif (!-e \$document_root\$fastcgi_script_name) {\n"; - $php_options_text .= "\t\t\treturn 404;\n"; - $php_options_text .= "\t\t}\n"; + $php_options_text .= "\t\ttry_files \$fastcgi_script_name =404;\n"; $php_options_text .= "\t\tfastcgi_pass unix:".$php->getInterface()->getSocketFile().";\n"; $php_options_text .= "\t\tfastcgi_index index.php;\n"; if ($domain['ssl'] == '1' && $ssl_vhost) {