diff --git a/src/nginxconfig/generators/conf/security.conf.js b/src/nginxconfig/generators/conf/security.conf.js index f7d7357..f82d1d8 100644 --- a/src/nginxconfig/generators/conf/security.conf.js +++ b/src/nginxconfig/generators/conf/security.conf.js @@ -50,6 +50,19 @@ export default (domains, global) => { deny: 'all', }]); + // Security.txt + if (global.security.securityTxt.computed) { + config.push(['# security.txt', '']); + config.push(['location /security.txt', { + return: '301 /.well-known/security.txt', + }]); + + // Custom security.txt path + config.push(['location = /.well-known/security.txt', { + alias: `${global.security.securityTxtPath.value}`, + }]); + } + // Done! return config; }; diff --git a/src/nginxconfig/templates/global_sections/security.vue b/src/nginxconfig/templates/global_sections/security.vue index 33ed2f5..9e4b86a 100644 --- a/src/nginxconfig/templates/global_sections/security.vue +++ b/src/nginxconfig/templates/global_sections/security.vue @@ -102,6 +102,41 @@ THE SOFTWARE. + +