@@ -464,6 +464,12 @@ function writeAppNginxConfig(app, bundle, callback) {
|
||||
var sourceDir = path.resolve(__dirname, '..');
|
||||
var endpoint = 'app';
|
||||
|
||||
let frameAncestorsQuoted = null, robotsTxtQuoted = null, hiddenUpstreamHeaders = [];
|
||||
const reverseProxyConfig = app.reverseProxyConfig || {}; // some of our code uses fake app objects
|
||||
if (reverseProxyConfig.robotsTxt) robotsTxtQuoted = JSON.stringify(app.reverseProxyConfig.robotsTxt);
|
||||
if (reverseProxyConfig.frameAncestors) frameAncestorsQuoted = app.reverseProxyConfig.frameAncestors.map(fa => `'${fa}'`).join(' ');
|
||||
if (reverseProxyConfig.hideHeaders) hiddenUpstreamHeaders = app.reverseProxyConfig.hideHeaders;
|
||||
|
||||
var data = {
|
||||
sourceDir: sourceDir,
|
||||
adminOrigin: settings.adminOrigin(),
|
||||
@@ -473,7 +479,9 @@ function writeAppNginxConfig(app, bundle, callback) {
|
||||
endpoint: endpoint,
|
||||
certFilePath: bundle.certFilePath,
|
||||
keyFilePath: bundle.keyFilePath,
|
||||
robotsTxtQuoted: app.robotsTxt ? JSON.stringify(app.robotsTxt) : null
|
||||
robotsTxtQuoted,
|
||||
frameAncestorsQuoted,
|
||||
hiddenUpstreamHeaders
|
||||
};
|
||||
var nginxConf = ejs.render(NGINX_APPCONFIG_EJS, data);
|
||||
|
||||
@@ -502,7 +510,9 @@ function writeAppRedirectNginxConfig(app, fqdn, bundle, callback) {
|
||||
endpoint: 'redirect',
|
||||
certFilePath: bundle.certFilePath,
|
||||
keyFilePath: bundle.keyFilePath,
|
||||
robotsTxtQuoted: null
|
||||
robotsTxtQuoted: null,
|
||||
frameAncestorsQuoted: null,
|
||||
hiddenUpstreamHeaders: []
|
||||
};
|
||||
var nginxConf = ejs.render(NGINX_APPCONFIG_EJS, data);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user