Skip to content

Commit c8c13a7

Browse files
committed
- Added random PHP dummy file to "location ~ \.php$ {}".
1 parent 7869813 commit c8c13a7

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

server/conf/nginx_vhost.conf.master

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ server {
106106
}
107107

108108
location ~ \.php$ {
109-
try_files @php @php;
109+
try_files <tmpl_var name='rnd_php_dummy_file'> @php;
110110
}
111111

112112
<tmpl_if name='php' op='==' value='php-fpm'>

server/plugins-available/nginx_plugin.inc.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -819,6 +819,7 @@ function update($event_name,$data) {
819819
$tpl->setVar('use_socket', $use_socket);
820820
$fpm_socket = $socket_dir.$pool_name.'.sock';
821821
$tpl->setVar('fpm_socket', $fpm_socket);
822+
$tpl->setVar('rnd_php_dummy_file', '/'.md5(uniqid(microtime(),1)).'.htm');
822823
$vhost_data['fpm_port'] = $web_config['php_fpm_start_port'] + $data['new']['domain_id'] - 1;
823824

824825
// backwards compatibility; since ISPConfig 3.0.5, the PHP mode for nginx is called 'php-fpm' instead of 'fast-cgi'. The following line makes sure that old web sites that have 'fast-cgi' in the database still get PHP-FPM support.

0 commit comments

Comments
 (0)