Skip to content

Commit 037bf6f

Browse files
committed
Fix Nginx SSL placeholders in apps_vhost_plugin.inc.php
1 parent 1a13adb commit 037bf6f

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

server/plugins-available/apps_vhost_plugin.inc.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,18 @@ function update($event_name, $data) {
204204
$use_tcp = '';
205205
$use_socket = '#';
206206
}
207+
208+
/* Check if SSL should be enabled: */
209+
if(is_file('/usr/local/ispconfig/interface/ssl/ispserver.crt') && is_file('/usr/local/ispconfig/interface/ssl/ispserver.key')) {
210+
$content = str_replace('{ssl_comment}', '', $content);
211+
$content = str_replace('{ssl_on}', 'ssl', $content);
212+
$content = str_replace('{vhost_port}', $web_config['apps_vhost_port'], $content);
213+
} else {
214+
$content = str_replace('{ssl_comment}', '#', $content);
215+
$content = preg_replace('/(\s)\{ssl_on\}/', '', $content);
216+
$content = str_replace('{vhost_port}', $web_config['apps_vhost_port'], $content);
217+
}
218+
207219
$content = str_replace('{use_tcp}', $use_tcp, $content);
208220
$content = str_replace('{use_socket}', $use_socket, $content);
209221

0 commit comments

Comments
 (0)