diff --git a/setup/start/nginx/appconfig.ejs b/setup/start/nginx/appconfig.ejs index 3463c80bf..d35dd0485 100644 --- a/setup/start/nginx/appconfig.ejs +++ b/setup/start/nginx/appconfig.ejs @@ -5,8 +5,12 @@ map $http_upgrade $connection_upgrade { } server { +<% if (vhost) { %> listen 443; server_name <%= vhost %>; +<% } else { %> + listen 443 default_server; +<% } %> ssl on; # paths are relative to prefix and not to this file diff --git a/src/cloudron.js b/src/cloudron.js index b009594ee..381619ba6 100644 --- a/src/cloudron.js +++ b/src/cloudron.js @@ -206,7 +206,7 @@ function configureAdmin(callback) { } // always create a configuration for the ip - nginx.configureAdmin(certFilePath, keyFilePath, IP_BASED_SETUP_NAME + '.conf', ip, function (error) { + nginx.configureAdmin(certFilePath, keyFilePath, IP_BASED_SETUP_NAME + '.conf', '', function (error) { if (error) return callback(error); // skip my.domain.com setup if we don't have a domain diff --git a/src/nginx.js b/src/nginx.js index 033b2bd17..a10426245 100644 --- a/src/nginx.js +++ b/src/nginx.js @@ -30,7 +30,7 @@ function configureAdmin(certFilePath, keyFilePath, configFileName, vhost, callba var data = { sourceDir: path.resolve(__dirname, '..'), adminOrigin: config.adminOrigin(), - vhost: vhost, + vhost: vhost, // if vhost is empty it will become the default_server endpoint: 'admin', certFilePath: certFilePath, keyFilePath: keyFilePath,