Files
server/opt/psa/admin/conf/templates/default/nginxDomainVhostIpDefault.php
2026-01-07 20:52:11 +01:00

40 lines
1.6 KiB
PHP

<?php
echo AUTOGENERATED_CONFIGS;
/** @var Template_VariableAccessor $VAR */
if ($VAR->domain->disabled) {
echo "# Domain is disabled\n";
return;
}
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' => true,
]);
}
}
}
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' => true,
]);
}
}