Support proxy app

This commit is contained in:
Johannes Zellner
2022-06-06 20:04:22 +02:00
parent 67801020ed
commit a955457ee7
5 changed files with 45 additions and 10 deletions

View File

@@ -501,11 +501,18 @@ async function writeAppNginxConfig(app, fqdn, type, bundle) {
cspQuoted: null,
hideHeaders: [],
proxyAuth: { enabled: false },
upstreamUri: '', // only for endpoint === external
ocsp: await isOcspEnabled(bundle.certFilePath)
};
if (type === apps.LOCATION_TYPE_PRIMARY || type === apps.LOCATION_TYPE_ALIAS || type === apps.LOCATION_TYPE_SECONDARY) {
data.endpoint = 'app';
if (app.manifest.id === constants.RELAY_APPSTORE_ID) {
data.endpoint = 'external';
data.upstreamUri = 'http://example.com';
}
// maybe these should become per domain at some point
const reverseProxyConfig = app.reverseProxyConfig || {}; // some of our code uses fake app objects
if (reverseProxyConfig.robotsTxt) data.robotsTxtQuoted = JSON.stringify(app.reverseProxyConfig.robotsTxt);