Skip to content

Commit 9220c71

Browse files
author
Till Brehm
committed
Merge branch 'fix_ssl_placeholders_in_nginx_apps_template' into 'develop'
Fix Nginx SSL placeholders in apps_vhost_plugin.inc.php See merge request ispconfig/ispconfig3!1259
2 parents 3c27e26 + 4efa7d7 commit 9220c71

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

server/plugins-available/apps_vhost_plugin.inc.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ function update($event_name, $data) {
192192
$content = str_replace('{fpm_socket}', $fpm_socket, $content);
193193
$content = str_replace('{cgi_socket}', $cgi_socket, $content);
194194
if( file_exists('/var/run/php5-fpm.sock')
195+
|| file_exists('/var/lib/php5-fpm/apps.sock')
195196
|| file_exists('/var/run/php/php7.0-fpm.sock')
196197
|| file_exists('/var/run/php/php7.1-fpm.sock')
197198
|| file_exists('/var/run/php/php7.2-fpm.sock')
@@ -204,6 +205,18 @@ function update($event_name, $data) {
204205
$use_tcp = '';
205206
$use_socket = '#';
206207
}
208+
209+
/* Check if SSL should be enabled: */
210+
if(is_file('/usr/local/ispconfig/interface/ssl/ispserver.crt') && is_file('/usr/local/ispconfig/interface/ssl/ispserver.key')) {
211+
$content = str_replace('{ssl_comment}', '', $content);
212+
$content = str_replace('{ssl_on}', 'ssl', $content);
213+
$content = str_replace('{vhost_port}', $web_config['apps_vhost_port'], $content);
214+
} else {
215+
$content = str_replace('{ssl_comment}', '#', $content);
216+
$content = preg_replace('/(\s)\{ssl_on\}/', '', $content);
217+
$content = str_replace('{vhost_port}', $web_config['apps_vhost_port'], $content);
218+
}
219+
207220
$content = str_replace('{use_tcp}', $use_tcp, $content);
208221
$content = str_replace('{use_socket}', $use_socket, $content);
209222

0 commit comments

Comments
 (0)