Intranet: Reverse Proxy/Websockets do not need a htdocs directory

This commit is contained in:
cytopia 2022-12-26 14:13:36 +01:00
parent 299b765652
commit 1ba3cd399c
No known key found for this signature in database
GPG Key ID: 6D56EDB8695128A2

View File

@ -29,10 +29,18 @@ class Httpd extends BaseClass implements BaseInterface
$url = 'http://'.$domain; $url = 'http://'.$domain;
$error = array(); $error = array();
// 1. Check htdocs folder
if (!$this->_is_valid_dir($docroot)) { $backend = $this->getVhostBackend($vhost);
$error[] = 'error'; $pos_def = strpos($backend, 'default');
$error[] = 'Missing <strong>'.$htdocs.'</strong> directory in: <strong>'.loadClass('Helper')->getEnv('HOST_PATH_HTTPD_DATADIR').'/'.$vhost.'/</strong>'; $pos_phpfpm = strpos($backend, 'tcp://');
// Only if backend 'default' or 'phpfpm', we need a htdocs/ directory
if ( ($pos_def !== false && $pos_def == 0) || ($pos_phpfpm !== false && $pos_phpfpm == 0) ) {
// 1. Check htdocs folder
if (!$this->_is_valid_dir($docroot)) {
$error[] = 'error';
$error[] = 'Missing <strong>'.$htdocs.'</strong> directory in: <strong>'.loadClass('Helper')->getEnv('HOST_PATH_HTTPD_DATADIR').'/'.$vhost.'/</strong>';
}
} }
// 2. Check internal DNS server // 2. Check internal DNS server