Single file config + formatting fixes!

This commit is contained in:
MattIPv4
2020-05-20 17:41:24 +01:00
parent 6a70c53107
commit 7fa39d4bcc
3 changed files with 45 additions and 11 deletions

View File

@@ -1,4 +1,5 @@
import sslProfiles from '../../util/ssl_profiles';
import websiteConf from './website.conf';
export default (domains, global) => {
const config = {};
@@ -105,7 +106,10 @@ export default (domains, global) => {
// Single file configs
if (!global.tools.modularizedStructure.computed) {
// TODO: figure out merging in all the other configs
for (const domain of domains) {
config.http.push([`# ${domain.server.domain.computed}`, '']);
config.http.push(...websiteConf(domain, domains, global));
}
}
// Done!

View File

@@ -132,7 +132,7 @@ export default (domain, domains, global) => {
&& (!domain.reverseProxy.reverseProxy.computed || domain.reverseProxy.path.computed !== '/')) {
serverConfig.push([`# index.${domain.routing.fallbackHtml.computed ? 'html' : (domain.routing.fallbackPhp.computed ? 'php' : '')} fallback`, '']);
serverConfig.push(['location /', {
try_files: `$uri $uri/ /index.${domain.routing.fallbackHtml.computed ? '.html' : (domain.routing.fallbackPhp.computed ? '.php?$query_string' : '')}`,
try_files: `$uri $uri/ /index.${domain.routing.fallbackHtml.computed ? 'html' : (domain.routing.fallbackPhp.computed ? 'php?$query_string' : '')}`,
}]);
}