Files
server/opt/psa/admin/conf/templates/default/nginxDomainVhost.php
cutemeli 0bfc6c8425 Initial
2025-12-22 10:32:59 +00:00

43 lines
1.6 KiB
PHP

<?php
echo AUTOGENERATED_CONFIGS;
/** @var Template_VariableAccessor $VAR */
if ($VAR->domain->disabled) {
echo "# Domain is disabled\n";
return;
}
echo $VAR->includeTemplate('domain/service/nginxCachePath.php');
if ($VAR->domain->physicalHosting->ssl) {
foreach ($VAR->domain->physicalHosting->ipAddresses as $ipAddress) {
if ($ipAddress->defaultDomainId !== $VAR->domain->id) {
echo $VAR->includeTemplate('domain/nginxDomainVirtualHost.php', [
'ssl' => true,
'http2' => $VAR->server->nginx->http2,
'http3' => $VAR->server->nginx->http3 && $VAR->domain->physicalHosting->isNginxHttp3Enabled(),
'frontendPort' => $VAR->server->nginx->httpsPort,
'backendPort' => $VAR->server->webserver->httpsPort,
'documentRoot' => $VAR->domain->physicalHosting->httpsDir,
'ipAddress' => $ipAddress,
'default' => false,
]);
}
}
}
foreach ($VAR->domain->physicalHosting->ipAddresses as $ipAddress) {
if ($ipAddress->defaultDomainId !== $VAR->domain->id) {
echo $VAR->includeTemplate('domain/nginxDomainVirtualHost.php', [
'ssl' => false,
'http2' => $VAR->server->nginx->http2,
'http3' => $VAR->server->nginx->http3 && $VAR->domain->physicalHosting->isNginxHttp3Enabled(),
'frontendPort' => $VAR->server->nginx->httpPort,
'backendPort' => $VAR->server->webserver->httpPort,
'documentRoot' => $VAR->domain->physicalHosting->httpDir,
'ipAddress' => $ipAddress,
'default' => false,
]);
}
}