Move generic PHP location block after specific rules (fixes #112)

pull/159/head
MattIPv4 2020-06-11 14:56:05 +01:00
parent 6aa05d6cd1
commit 16a860f5ca
1 changed files with 14 additions and 14 deletions

View File

@ -207,20 +207,6 @@ export default (domain, domains, global) => {
serverConfig.push([`location ${domain.reverseProxy.path.computed}`, locConf]);
}
// PHP
if (domain.php.php.computed) {
serverConfig.push(['# handle .php', '']);
const loc = `location ~ ${domain.routing.legacyPhpRouting.computed ? '[^/]\\.php(/|$)' : '\\.php$'}`;
if (global.tools.modularizedStructure.computed || domain.php.wordPressRules.computed) {
// Modularized
serverConfig.push([loc, { include: 'nginxconfig.io/php_fastcgi.conf' }]);
} else {
// Unified
serverConfig.push([loc, phpConf(domains, global)]);
}
}
// Additional config
if (global.tools.modularizedStructure.computed) {
// Modularized
@ -245,6 +231,20 @@ export default (domain, domains, global) => {
if (domain.php.magentoRules.computed) serverConfig.push(...Object.entries(magentoConf()));
}
// PHP
if (domain.php.php.computed) {
serverConfig.push(['# handle .php', '']);
const loc = `location ~ ${domain.routing.legacyPhpRouting.computed ? '[^/]\\.php(/|$)' : '\\.php$'}`;
if (global.tools.modularizedStructure.computed || domain.php.wordPressRules.computed) {
// Modularized
serverConfig.push([loc, { include: 'nginxconfig.io/php_fastcgi.conf' }]);
} else {
// Unified
serverConfig.push([loc, phpConf(domains, global)]);
}
}
// Add the server config to the parent config now its built
config.push(['server', serverConfig]);