diff --git a/install/lib/install.lib.php b/install/lib/install.lib.php
index 11c6707cbe4be65d933564b9a3326ba21a162816..0f57e1f456f9ac1bd19e2d7fcedecf78f48a2fec 100644
--- a/install/lib/install.lib.php
+++ b/install/lib/install.lib.php
@@ -835,7 +835,7 @@ function is_installed($appname) {
 
 function get_ispconfig_port_number() {
 	global $conf;
-	if($conf['nginx']['installed'] == true){
+	if(is_file($conf['nginx']['vhost_conf_dir'].'/ispconfig.vhost')) {
 		$ispconfig_vhost_file = $conf['nginx']['vhost_conf_dir'].'/ispconfig.vhost';
 		$regex = '/listen (\d+)/';
 	} else {
@@ -861,7 +861,7 @@ function get_ispconfig_port_number() {
 
 function get_apps_vhost_port_number() {
 	global $conf;
-	if($conf['nginx']['installed'] == true){
+	if(is_file($conf['nginx']['vhost_conf_dir'].'/apps.vhost')) {
 		$ispconfig_vhost_file = $conf['nginx']['vhost_conf_dir'].'/apps.vhost';
 		$regex = '/listen (\d+)/';
 	} else {