Skip to content

Commit

Permalink
nginx: add index directive to path options for secured directories
Browse files Browse the repository at this point in the history
`index` directives are now created for secured directory locations.
  • Loading branch information
oliverrahner committed Jun 10, 2017
1 parent e95a917 commit aa8a7ee
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions scripts/jobs/cron_tasks.inc.http.30.nginx.php
Original file line number Diff line number Diff line change
Expand Up @@ -719,6 +719,11 @@ protected function create_pathOptions($domain)
if ($single['path'] == '/') {
$path_options .= "\t\t" . 'auth_basic "' . $single['authname'] . '";' . "\n";
$path_options .= "\t\t" . 'auth_basic_user_file ' . makeCorrectFile($single['usrf']) . ';' . "\n";
if ($domain['phpenabled_customer'] == 1 && $domain['phpenabled_vhost'] == '1') {
$path_options .= "\t\t" . 'index index.php index.html index.htm;' . "\n";
} else {
$path_options .= "\t\t" . 'index index.html index.htm;' . "\n";
}
$path_options .= "\t\t" . 'location ~ ^(.+?\.php)(/.*)?$ {' . "\n";
$path_options .= "\t\t\t" . 'try_files ' . $domain['nonexistinguri'] . ' @php;' . "\n";
$path_options .= "\t\t" . '}' . "\n";
Expand Down Expand Up @@ -776,6 +781,11 @@ protected function create_pathOptions($domain)
$path_options .= "\t" . 'location ' . makeCorrectDir($single['path']) . ' {' . "\n";
$path_options .= "\t\t" . 'auth_basic "' . $single['authname'] . '";' . "\n";
$path_options .= "\t\t" . 'auth_basic_user_file ' . makeCorrectFile($single['usrf']) . ';' . "\n";
if ($domain['phpenabled_customer'] == 1 && $domain['phpenabled_vhost'] == '1') {
$path_options .= "\t\t" . 'index index.php index.html index.htm;' . "\n";
} else {
$path_options .= "\t\t" . 'index index.html index.htm;' . "\n";
}
$path_options .= "\t\t" . 'location ~ ^(.+?\.php)(/.*)?$ {' . "\n";
$path_options .= "\t\t\t" . 'try_files ' . $domain['nonexistinguri'] . ' @php;' . "\n";
$path_options .= "\t\t" . '}' . "\n";
Expand Down

0 comments on commit aa8a7ee

Please sign in to comment.