diff --git a/box.js b/box.js index 5e7173c14..a4e698a6a 100755 --- a/box.js +++ b/box.js @@ -30,7 +30,7 @@ async.series([ server.start, ldap.start, appHealthMonitor.start, - oauthproxy.start.bind(null, 4000 /* port */) + oauthproxy.start ], function (error) { if (error) { console.error('Error starting server', error); diff --git a/setup/start/nginx/appconfig.ejs b/setup/start/nginx/appconfig.ejs index 8c7c14181..60a9a75ce 100644 --- a/setup/start/nginx/appconfig.ejs +++ b/setup/start/nginx/appconfig.ejs @@ -69,7 +69,7 @@ server { } <% } else if ( endpoint === 'oauthproxy' ) { %> - proxy_pass http://127.0.0.1:4000; + proxy_pass http://127.0.0.1:3003; proxy_set_header X-Cloudron-Proxy-Port <%= port %>; <% } else if ( endpoint === 'app' ) { %> proxy_pass http://127.0.0.1:<%= port %>; diff --git a/src/config.js b/src/config.js index c0e2a3d7c..13849f2f0 100644 --- a/src/config.js +++ b/src/config.js @@ -73,6 +73,7 @@ function initConfig() { data.webServerOrigin = null; data.internalPort = 3001; data.ldapPort = 3002; + data.oauthProxyPort = 3003; data.backupKey = 'backupKey'; data.aws = { backupBucket: null, diff --git a/src/oauthproxy.js b/src/oauthproxy.js index 565b0fe36..1cf2d273e 100644 --- a/src/oauthproxy.js +++ b/src/oauthproxy.js @@ -172,13 +172,12 @@ function initializeServer() { return httpServer; } -function start(port, callback) { - assert.strictEqual(typeof port, 'number'); +function start(callback) { assert.strictEqual(typeof callback, 'function'); gHttpServer = initializeServer(); - gHttpServer.listen(port, callback); + gHttpServer.listen(config.get('oauthProxyPort'), callback); } function stop(callback) {