Move generic PHP location block after specific rules (fixes #112)
parent
6aa05d6cd1
commit
16a860f5ca
|
@ -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]);
|
||||
|
||||
|
|
Loading…
Reference in New Issue