Skip to content
This repository has been archived by the owner on Jan 17, 2023. It is now read-only.

Commit

Permalink
Fix fastcgi off
Browse files Browse the repository at this point in the history
  • Loading branch information
willnode committed Jun 25, 2021
1 parent 76dd8e4 commit 3f0f887
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions src/nginx/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,20 @@
}
$d['fcgi'] = $matches[2];
$c = mergeConfig($config);
$c['locations'][] = [
'match' => '~ \.php(/|$)',
'try_files' => $c['fastcgi'] == 'on' ? '$uri =404' : '=404',
'fastcgi_pass' => $d['fcgi'],
];
if ($c['fastcgi'] == 'on') {
$c['locations'][] = [
'match' => '~ \.php(/|$)',
'try_files' => '$uri =404',
'fastcgi_pass' => $d['fcgi'],
];
} else {
$c['locations'][] = [
'match' => '~ \.php(/|$)',
'return' => '404',
'fastcgi_pass' => $d['fcgi'],
];
}

// all necessary data in, now cut
ob_start();
include "template.php";
Expand Down

0 comments on commit 3f0f887

Please sign in to comment.