diff --git a/install/dist/lib/fedora.lib.php b/install/dist/lib/fedora.lib.php
index f1d57f9c83fdb12327395262570c061feaca865b..889bd4288dd7119e719de99505c829a77610148d 100644
--- a/install/dist/lib/fedora.lib.php
+++ b/install/dist/lib/fedora.lib.php
@@ -1253,11 +1253,11 @@ class installer_dist extends installer_base {
 			$content = str_replace('{vhost_port}', $conf['nginx']['vhost_port'], $content);
 
 			if(is_file($install_dir.'/interface/ssl/ispserver.crt') && is_file($install_dir.'/interface/ssl/ispserver.key')) {
-				$content = str_replace('{ssl_on}', ' on', $content);
+				$content = str_replace('{ssl_on}', 'ssl', $content);
 				$content = str_replace('{ssl_comment}', '', $content);
 				$content = str_replace('{fastcgi_ssl}', 'on', $content);
 			} else {
-				$content = str_replace('{ssl_on}', ' off', $content);
+				$content = str_replace('{ssl_on}', '', $content);
 				$content = str_replace('{ssl_comment}', '#', $content);
 				$content = str_replace('{fastcgi_ssl}', 'off', $content);
 			}
diff --git a/install/dist/lib/gentoo.lib.php b/install/dist/lib/gentoo.lib.php
index af692b16896abdc8d4c6c1107cce3429d59e6003..5bb0d9df1966347d54e9dd1b39d62dc462977560 100644
--- a/install/dist/lib/gentoo.lib.php
+++ b/install/dist/lib/gentoo.lib.php
@@ -785,7 +785,7 @@ class installer extends installer_base
 			$content = str_replace('{cgi_socket}', $cgi_socket, $content);
 			
 			// SSL in apps vhost is off by default. Might change later.
-			$content = str_replace('{ssl_on}', 'off', $content);
+			$content = str_replace('{ssl_on}', 'ssl', $content);
 			$content = str_replace('{ssl_comment}', '#', $content);
 			
 			wf($vhost_conf_dir.'/apps.vhost', $content);
@@ -1139,11 +1139,11 @@ class installer extends installer_base
 			$content = str_replace('{vhost_port}', $conf['nginx']['vhost_port'], $content);
 
 			if(is_file($install_dir.'/interface/ssl/ispserver.crt') && is_file($install_dir.'/interface/ssl/ispserver.key')) {
-				$content = str_replace('{ssl_on}', ' on', $content);
+				$content = str_replace('{ssl_on}', 'ssl', $content);
 				$content = str_replace('{ssl_comment}', '', $content);
 				$content = str_replace('{fastcgi_ssl}', 'on', $content);
 			} else {
-				$content = str_replace('{ssl_on}', ' off', $content);
+				$content = str_replace('{ssl_on}', '', $content);
 				$content = str_replace('{ssl_comment}', '#', $content);
 				$content = str_replace('{fastcgi_ssl}', 'off', $content);
 			}
diff --git a/install/dist/lib/opensuse.lib.php b/install/dist/lib/opensuse.lib.php
index 6856317f934a3cac1451373bd7613071754558e1..21cfd9f2bad9d929e280f9abd5d091444131bff7 100644
--- a/install/dist/lib/opensuse.lib.php
+++ b/install/dist/lib/opensuse.lib.php
@@ -1264,11 +1264,11 @@ class installer_dist extends installer_base {
 			$content = str_replace('{vhost_port}', $conf['nginx']['vhost_port'], $content);
 
 			if(is_file($install_dir.'/interface/ssl/ispserver.crt') && is_file($install_dir.'/interface/ssl/ispserver.key')) {
-				$content = str_replace('{ssl_on}', ' on', $content);
+				$content = str_replace('{ssl_on}', 'ssl', $content);
 				$content = str_replace('{ssl_comment}', '', $content);
 				$content = str_replace('{fastcgi_ssl}', 'on', $content);
 			} else {
-				$content = str_replace('{ssl_on}', ' off', $content);
+				$content = str_replace('{ssl_on}', '', $content);
 				$content = str_replace('{ssl_comment}', '#', $content);
 				$content = str_replace('{fastcgi_ssl}', 'off', $content);
 			}
diff --git a/install/lib/installer_base.lib.php b/install/lib/installer_base.lib.php
index 10cfbaf9654bb5f8e31652069f5a01eb97a7dbc3..385b6e13bd9c4228e0343565d64dfb23837540f6 100644
--- a/install/lib/installer_base.lib.php
+++ b/install/lib/installer_base.lib.php
@@ -2131,7 +2131,7 @@ class installer_base {
 			$content = str_replace('{use_socket}', $use_socket, $content);
 			
 			// SSL in apps vhost is off by default. Might change later.
-			$content = str_replace('{ssl_on}', 'off', $content);
+			$content = str_replace('{ssl_on}', '', $content);
 			$content = str_replace('{ssl_comment}', '#', $content);
 			
 			// Fix socket path on PHP 7 systems
@@ -2564,11 +2564,11 @@ class installer_base {
 			$content = str_replace('{vhost_port}', $conf['nginx']['vhost_port'], $content);
 
 			if(is_file($install_dir.'/interface/ssl/ispserver.crt') && is_file($install_dir.'/interface/ssl/ispserver.key')) {
-				$content = str_replace('{ssl_on}', 'on', $content);
+				$content = str_replace('{ssl_on}', 'ssl', $content);
 				$content = str_replace('{ssl_comment}', '', $content);
 				$content = str_replace('{fastcgi_ssl}', 'on', $content);
 			} else {
-				$content = str_replace('{ssl_on}', 'off', $content);
+				$content = str_replace('{ssl_on}', '', $content);
 				$content = str_replace('{ssl_comment}', '#', $content);
 				$content = str_replace('{fastcgi_ssl}', 'off', $content);
 			}
diff --git a/install/tpl/nginx_apps.vhost.master b/install/tpl/nginx_apps.vhost.master
index e1bb6d1849d40e2eb3681ac807c98860f07f6c1c..3d00d11106d48a3e8289d6fbc7ca057bdb34620a 100644
--- a/install/tpl/nginx_apps.vhost.master
+++ b/install/tpl/nginx_apps.vhost.master
@@ -1,7 +1,7 @@
 server {
-        listen {apps_vhost_port};
-        listen [::]:{apps_vhost_port} ipv6only=on;
-        ssl {ssl_on};
+        listen {apps_vhost_port} {ssl_on};
+        listen [::]:{apps_vhost_port} {ssl_on} ipv6only=on;
+
         {ssl_comment}ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
         {ssl_comment}ssl_certificate /usr/local/ispconfig/interface/ssl/ispserver.crt;
         {ssl_comment}ssl_certificate_key /usr/local/ispconfig/interface/ssl/ispserver.key;
diff --git a/install/tpl/nginx_ispconfig.vhost.master b/install/tpl/nginx_ispconfig.vhost.master
index 3c8bf5dbaf749f4fca8ba08a44fa8ebe4404a8d3..aad670e97a8a74d022eb3c0c11927c559bd858d6 100644
--- a/install/tpl/nginx_ispconfig.vhost.master
+++ b/install/tpl/nginx_ispconfig.vhost.master
@@ -1,7 +1,7 @@
 server {
-        listen {vhost_port};
-        listen [::]:{vhost_port} ipv6only=on;
-		ssl {ssl_on};
+        listen {vhost_port} {ssl_on};
+        listen [::]:{vhost_port} {ssl_on} ipv6only=on;
+		
 		{ssl_comment}ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
         {ssl_comment}ssl_certificate /usr/local/ispconfig/interface/ssl/ispserver.crt;
         {ssl_comment}ssl_certificate_key /usr/local/ispconfig/interface/ssl/ispserver.key;