This commit is contained in:
cutemeli
2025-12-22 10:35:30 +00:00
parent 0bfc6c8425
commit 5ce7ca2c5d
38927 changed files with 0 additions and 4594700 deletions

View File

@@ -1,7 +0,0 @@
<?php if ($VAR->server->webserver->apache->traceEnableCompliance): ?>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_METHOD} ^TRACE
RewriteRule .* - [F]
</IfModule>
<?php endif; ?>

View File

@@ -1,380 +0,0 @@
<?php
/**
* @var Template_VariableAccessor $VAR
* @var array $OPT
*/
?>
<?php if ($OPT['ssl']): ?>
<IfModule mod_ssl.c>
<?php endif; ?>
<VirtualHost <?php echo $OPT['ipAddress']->escapedAddress ?>:<?php echo $OPT['ssl'] ? $VAR->server->webserver->httpsPort : $VAR->server->webserver->httpPort ?> <?php echo ($VAR->server->webserver->proxyActive && $OPT['ipAddress']->isIpV6()) ? "127.0.0.1:" . ($OPT['ssl'] ? $VAR->server->webserver->httpsPort : $VAR->server->webserver->httpPort) : ''; ?>>
ServerName "<?php echo $VAR->domain->asciiName ?>"
<?php if ($VAR->domain->isWildcard): ?>
ServerAlias "<?php echo $VAR->domain->wildcardName ?>"
<?php else: ?>
ServerAlias "www.<?php echo $VAR->domain->asciiName ?>"
<?php endif; ?>
<?php if ($VAR->server->webserver->listenLocalhost): ?>
<?php if ($VAR->domain->physicalHosting->hasIpV6()): ?>
ServerAlias "ipv6.<?php echo $VAR->domain->asciiName ?>"
<?php endif; ?>
<?php if ($VAR->domain->physicalHosting->hasIpV4()): ?>
ServerAlias "ipv4.<?php echo $VAR->domain->asciiName ?>"
<?php endif; ?>
<?php else: ?>
<?php if ($OPT['ipAddress']->isIpV6()): ?>
ServerAlias "ipv6.<?php echo $VAR->domain->asciiName ?>"
<?php elseif ($OPT['ipAddress']->isIpV4()): ?>
ServerAlias "ipv4.<?php echo $VAR->domain->asciiName ?>"
<?php endif; ?>
<?php endif; ?>
<?php foreach ($VAR->domain->webAliases AS $alias): ?>
ServerAlias "<?php echo $alias->asciiName ?>"
ServerAlias "www.<?php echo $alias->asciiName ?>"
<?php if ($VAR->server->webserver->listenLocalhost): ?>
<?php if ($VAR->domain->physicalHosting->hasIpV6()): ?>
ServerAlias "ipv6.<?php echo $alias->asciiName ?>"
<?php endif; ?>
<?php if ($VAR->domain->physicalHosting->hasIpV4()): ?>
ServerAlias "ipv4.<?php echo $alias->asciiName ?>"
<?php endif; ?>
<?php else: ?>
<?php if ($OPT['ipAddress']->isIpV6()): ?>
ServerAlias "ipv6.<?php echo $alias->asciiName ?>"
<?php elseif ($OPT['ipAddress']->isIpV4()): ?>
ServerAlias "ipv4.<?php echo $alias->asciiName ?>"
<?php endif; ?>
<?php endif; ?>
<?php endforeach; ?>
<?php if ($VAR->domain->previewDomainName): ?>
ServerAlias "<?php echo $VAR->domain->previewDomainName ?>"
<?php endif; ?>
<?php if ($VAR->server->webserver->listenLocalhost): ?>
<?php foreach ($VAR->domain->physicalHosting->ipAddresses as $ip): ?>
<?php if ($ip->defaultDomainId === $VAR->domain->id): ?>
ServerAlias "<?php echo $ip->defaultServerName ?>"
<?php endif; ?>
<?php endforeach; ?>
<?php endif; ?>
UseCanonicalName Off
<?php if (!$VAR->server->webserver->apache->pipelogEnabled): ?>
CustomLog <?php echo $VAR->domain->physicalHosting->logsDir ?>/<?php echo $OPT['ssl'] ? 'access_ssl_log' : 'access_log' ?> plesklog
<?php endif; ?>
ErrorLog "<?php echo $VAR->domain->physicalHosting->logsDir ?>/error_log"
<?php if ($VAR->domain->isMailAutodiscoveryEnabled): ?>
<?php echo $VAR->includeTemplate('domain/service/mailAutoConfig.php') ?>
<?php endif ?>
<?php if (!$OPT['ssl'] && $VAR->domain->physicalHosting->sslRedirect): ?>
<?php if (is_file($VAR->domain->physicalHosting->customConfigFile)): ?>
Include "<?php echo $VAR->domain->physicalHosting->customConfigFile ?>"
<?php endif; ?>
<?php echo $VAR->includeTemplate('domain/service/seoSafeRedirects.php', array('ssl' => true)); ?>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L,QSA]
</IfModule>
</VirtualHost>
<?php return; ?>
<?php endif; ?>
DocumentRoot "<?php echo $OPT['ssl'] ? $VAR->domain->physicalHosting->httpsDir : $VAR->domain->physicalHosting->httpDir ?>"
<IfModule mod_suexec.c>
SuexecUserGroup "<?php echo $VAR->domain->physicalHosting->login ?>" "<?php echo $VAR->server->webserver->clientGroup ?>"
</IfModule>
<?php echo $VAR->includeTemplate('domain/PCI_compliance.php') ?>
<IfModule mod_userdir.c>
<?php if (count($VAR->domain->physicalHosting->webusers)): ?>
<?php foreach (array_chunk($VAR->domain->physicalHosting->webusers, 50) AS $chunk): ?>
UserDir enabled <?php echo implode(" ", array_map(function($webuser) { return $webuser->login;}, $chunk)) ?>
<?php endforeach; ?>
<?php endif; ?>
UserDir "<?php echo $VAR->domain->physicalHosting->webUsersDir ?>/*"
</IfModule>
<?php if ($VAR->domain->physicalHosting->vhostId): ?>
<IfModule mod_sysenv.c>
SetSysEnv PP_VHOST_ID "<?php echo $VAR->domain->physicalHosting->vhostId ?>"
</IfModule>
<?php endif; ?>
<?php if ($VAR->domain->physicalHosting->cgi && !$VAR->domain->physicalHosting->rootApplication): ?>
ScriptAlias "/cgi-bin/" "<?php echo $VAR->domain->physicalHosting->cgiBinDir ?>/"
<?php endif; ?>
<?php if ($VAR->domain->physicalHosting->hasWebstat):?>
<?php if ($OPT['ssl'] || !$VAR->domain->physicalHosting->ssl): ?>
Alias "/plesk-stat" "<?php echo $VAR->domain->physicalHosting->statisticsDir ?>"
<Location /plesk-stat/>
Options +Indexes
</Location>
<Location /plesk-stat/logs/>
Require valid-user
</Location>
Alias /webstat <?php echo $VAR->domain->physicalHosting->statisticsDir ?>/webstat
Alias /webstat-ssl <?php echo $VAR->domain->physicalHosting->statisticsDir ?>/webstat-ssl
Alias /ftpstat <?php echo $VAR->domain->physicalHosting->statisticsDir ?>/ftpstat
Alias /anon_ftpstat <?php echo $VAR->domain->physicalHosting->statisticsDir ?>/anon_ftpstat
Alias /awstats-icon <?php echo $VAR->server->awstats->iconsDir ?>
<?php else: ?>
Redirect permanent /plesk-stat https://<?php echo $VAR->domain->urlName ?>/plesk-stat
Redirect permanent /webstat https://<?php echo $VAR->domain->urlName ?>/webstat
Redirect permanent /webstat-ssl https://<?php echo $VAR->domain->urlName ?>/webstat-ssl
Redirect permanent /ftpstat https://<?php echo $VAR->domain->urlName ?>/ftpstat
Redirect permanent /anon_ftpstat https://<?php echo $VAR->domain->urlName ?>/anon_ftpstat
Redirect permanent /awstats-icon https://<?php echo $VAR->domain->urlName ?>/awstats-icon
<?php endif; ?>
<?php endif; ?>
<?php if ($OPT['ssl']): ?>
<?php $sslCertificate = $VAR->server->sni && $VAR->domain->physicalHosting->sslCertificate ?
$VAR->domain->physicalHosting->sslCertificate :
$OPT['ipAddress']->sslCertificate; ?>
<?php if ($sslCertificate->ceFilePath): ?>
SSLEngine on
SSLVerifyClient none
SSLCertificateFile <?php echo $sslCertificate->ceFilePath ?>
<?php if ($sslCertificate->caFilePath): ?>
SSLCACertificateFile <?php echo $sslCertificate->caFilePath ?>
<?php endif; ?>
<?php endif; ?>
<?php else: ?>
<IfModule mod_ssl.c>
SSLEngine off
</IfModule>
<?php endif; ?>
<?php if ($VAR->domain->physicalHosting->php && $VAR->domain->physicalHosting->phpHandlerType == 'cgi'): ?>
SetEnv PP_CUSTOM_PHP_INI <?php echo $VAR->domain->physicalHosting->vhostSystemDir ?>/etc/php.ini
SetEnv PP_CUSTOM_PHP_CGI_INDEX <?php echo $VAR->domain->physicalHosting->phpHandlerId ?>
<?php endif; ?>
<?php if ($VAR->domain->physicalHosting->php && $VAR->domain->physicalHosting->phpHandlerType == 'fastcgi'): ?>
<IfModule mod_fcgid.c>
FcgidInitialEnv PP_CUSTOM_PHP_INI <?php echo $VAR->domain->physicalHosting->vhostSystemDir ?>/etc/php.ini
FcgidInitialEnv PP_CUSTOM_PHP_CGI_INDEX <?php echo $VAR->domain->physicalHosting->phpHandlerId ?>
FcgidMaxRequestLen 134217728
<?php if ($VAR->domain->physicalHosting->scriptTimeout): ?>
FcgidIOTimeout <?php echo $VAR->domain->physicalHosting->scriptTimeout; ?>
<?php endif; ?>
</IfModule>
<?php endif; ?>
<?php if ($VAR->domain->physicalHosting->scriptTimeout): ?>
TimeOut <?php echo $VAR->domain->physicalHosting->scriptTimeout; ?>
<?php endif; ?>
<Directory <?php echo $OPT['ssl'] ? $VAR->domain->physicalHosting->httpsDir : $VAR->domain->physicalHosting->httpDir ?>>
<?php
if ($VAR->domain->physicalHosting->perl) {
echo $VAR->includeTemplate('service/mod_perl.php');
}
if (
!$VAR->domain->physicalHosting->php ||
!in_array($VAR->domain->physicalHosting->phpHandlerType, array('cgi', 'fastcgi', 'fpm'))
) {
echo $VAR->includeTemplate('service/php.php', array(
'enabled' => $VAR->domain->physicalHosting->php,
'safe_mode' => $VAR->domain->physicalHosting->phpSafeMode,
'dir' => $OPT['ssl'] ? $VAR->domain->physicalHosting->httpsDir : $VAR->domain->physicalHosting->httpDir,
'settings' => $VAR->domain->physicalHosting->phpSettings,
));
}
if ($VAR->domain->physicalHosting->python) {
echo $VAR->includeTemplate('service/mod_python.php');
}
if ($VAR->domain->physicalHosting->fastcgi) {
echo $VAR->includeTemplate('service/mod_fastcgi.php');
}
if ($VAR->domain->physicalHosting->php && 'cgi' == $VAR->domain->physicalHosting->phpHandlerType) {
echo $VAR->includeTemplate('service/php_over_cgi.php');
}
if ($VAR->domain->physicalHosting->php && 'fastcgi' == $VAR->domain->physicalHosting->phpHandlerType) {
echo $VAR->includeTemplate('service/php_over_fastcgi.php');
}
if ($VAR->domain->physicalHosting->php && 'fpm' == $VAR->domain->physicalHosting->phpHandlerType) {
echo $VAR->includeTemplate('service/php_over_fpm.php');
}
?>
<?php if ($OPT['ssl']): ?>
SSLRequireSSL
<?php endif; ?>
Options <?php echo $VAR->domain->physicalHosting->ssi ? '+' : '-' ?>Includes <?php echo $VAR->domain->physicalHosting->cgi ? '+' : '-' ?>ExecCGI
</Directory>
<?php if ($VAR->domain->physicalHosting->webusersScriptingEnabled): ?>
<?php foreach ($VAR->domain->physicalHosting->webusers as $webuser): ?>
<Directory <?php echo $webuser->dir ?>>
Options <?php echo $VAR->domain->physicalHosting->ssi && $webuser->ssi ? '+' : '-' ?>Includes <?php echo $VAR->domain->physicalHosting->cgi && $webuser->cgi ? '+' : '-' ?>ExecCGI
<?php if ($VAR->domain->physicalHosting->cgi && $webuser->cgi): ?>
AddHandler cgi-script .cgi
<?php endif; ?>
<?php
if ($VAR->domain->physicalHosting->perl && $webuser->perl) {
echo $VAR->includeTemplate('service/mod_perl.php');
}
if (
!$VAR->domain->physicalHosting->php ||
!in_array($VAR->domain->physicalHosting->phpHandlerType, array('cgi', 'fastcgi', 'fpm'))
) {
echo $VAR->includeTemplate('service/php.php', array(
'enabled' => $VAR->domain->physicalHosting->php && $webuser->php,
'safe_mode' => $VAR->domain->physicalHosting->phpSafeMode,
'dir' => $webuser->dir,
'settings' => $webuser->phpSettings,
));
}
if ($VAR->domain->physicalHosting->php && $webuser->php && 'cgi' == $VAR->domain->physicalHosting->phpHandlerType) {
echo $VAR->includeTemplate('service/php_over_cgi.php');
}
if ($VAR->domain->physicalHosting->php && $webuser->php && 'fastcgi' == $VAR->domain->physicalHosting->phpHandlerType) {
echo $VAR->includeTemplate('service/php_over_fastcgi.php');
}
if ($VAR->domain->physicalHosting->php && $webuser->php && 'fpm' == $VAR->domain->physicalHosting->phpHandlerType) {
echo $VAR->includeTemplate('service/php_over_fpm.php');
}
if ($VAR->domain->physicalHosting->python && $webuser->python) {
echo $VAR->includeTemplate('service/mod_python.php');
}
if ($VAR->domain->physicalHosting->fastcgi && $webuser->fastcgi) {
echo $VAR->includeTemplate('service/mod_fastcgi.php');
}
?>
</Directory>
<?php endforeach; ?>
<?php else: ?>
<Directory <?php echo $VAR->domain->physicalHosting->webUsersDir ?>>
<?php echo $VAR->includeTemplate('service/php.php', array(
'enabled' => false,
'safe_mode' => true,
'dir' => $VAR->domain->physicalHosting->webUsersDir,
'settings' => $VAR->domain->physicalHosting->phpSettings,
)); ?>
</Directory>
<?php endif; ?>
<?php if (!$VAR->domain->physicalHosting->isMainDomain): ?>
<Directory <?php echo $VAR->domain->physicalHosting->vhostDir ?>>
Options +FollowSymLinks
</Directory>
<?php endif ?>
<?php
echo $VAR->includeTemplate('domain/service/protectedDirectories.php', $OPT) . "\n";
if ($VAR->domain->physicalHosting->errordocs) {
echo $VAR->includeTemplate('domain/service/errordocs.php') . "\n";
}
?>
<?php if (is_dir($OPT['ssl'] ? $VAR->domain->physicalHosting->siteAppsSslConfigDir : $VAR->domain->physicalHosting->siteAppsConfigDir)): ?>
<?php echo $VAR->server->webserver->includeOptionalConfig(($OPT['ssl'] ? $VAR->domain->physicalHosting->siteAppsSslConfigDir : $VAR->domain->physicalHosting->siteAppsConfigDir) . '/*.conf') ?>
<?php endif; ?>
<?php echo $VAR->domain->physicalHosting->apacheSettings ?>
<?php if ($VAR->domain->physicalHosting->directoryIndex): ?>
DirectoryIndex <?=$VAR->quote($VAR->domain->physicalHosting->directoryIndex)?>
<?php endif ?>
<?php echo $VAR->includeTemplate('domain/service/seoSafeRedirects.php', array('ssl' => $OPT['ssl'])); ?>
<?php if ($VAR->domain->suspended): ?>
<?php echo $VAR->includeTemplate('domain/service/suspend.php'); ?>
<?php endif; ?>
<?php if (is_file($OPT['ssl'] ? $VAR->domain->physicalHosting->customSslConfigFile : $VAR->domain->physicalHosting->customConfigFile)): ?>
Include "<?php echo $OPT['ssl'] ? $VAR->domain->physicalHosting->customSslConfigFile : $VAR->domain->physicalHosting->customConfigFile ?>"
<?php endif; ?>
<?php if ($VAR->domain->physicalHosting->apacheWebAppFirewallSettings): ?>
<IfModule mod_security2.c>
<?php echo $VAR->domain->physicalHosting->apacheWebAppFirewallSettings ?>
</IfModule>
<?php endif ?>
<Directory <?php echo $VAR->webspace->vhostDir ?>>
<?php if ($VAR->domain->physicalHosting->restrictFollowSymLinks): ?>
Options -FollowSymLinks
<?php endif ?>
<?php
$allowOverrideOptions = ['Indexes', 'SymLinksIfOwnerMatch', 'MultiViews'];
if (!$VAR->domain->physicalHosting->restrictFollowSymLinks) {
$allowOverrideOptions[] = 'FollowSymLinks';
}
if ($VAR->domain->physicalHosting->cgi || $VAR->server->webserver->apache->allowOverrideExecCGI) {
$allowOverrideOptions[] = 'ExecCGI';
}
if ($VAR->domain->physicalHosting->ssi || $VAR->server->webserver->apache->allowOverrideIncludes) {
$allowOverrideOptions[] = 'Includes';
$allowOverrideOptions[] = 'IncludesNOEXEC';
}
?>
AllowOverride AuthConfig FileInfo Indexes Limit Options=<?=implode(',', $allowOverrideOptions)?>
</Directory>
<?php if (!$VAR->server->webserver->proxyActive): ?>
<?php if ($VAR->domain->physicalHosting->expires): ?>
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus <?=$VAR->escape($VAR->domain->physicalHosting->expires)?> seconds"
</IfModule>
<?php endif ?>
<IfModule mod_headers.c>
<?php foreach ((array)$VAR->domain->physicalHosting->headers as list($name, $value)): ?>
Header add <?=$VAR->quote([$name, $value])?>
<?php endforeach ?>
</IfModule>
<?php endif ?>
<?=$VAR->domain->physicalHosting->extensionsConfigs?>
</VirtualHost>
<?php if ($OPT['ssl']): ?>
</IfModule>
<?php endif ?>

View File

@@ -1,79 +0,0 @@
<?php
/**
* @var Template_VariableAccessor $VAR
* @var array $OPT
*/
?>
<?php if ($OPT['ssl']): ?>
<IfModule mod_ssl.c>
<?php endif; ?>
<VirtualHost <?php echo $OPT['ipAddress']->escapedAddress?>:<?php echo $OPT['ssl'] ? $VAR->server->webserver->httpsPort : $VAR->server->webserver->httpPort ?> <?php echo ($VAR->server->webserver->proxyActive && $OPT['ipAddress']->address !== '127.0.0.1') ? "127.0.0.1:" . ($OPT['ssl'] ? $VAR->server->webserver->httpsPort : $VAR->server->webserver->httpPort) : ''; ?>>
ServerName "<?php echo $VAR->domain->asciiName ?>"
<?php if ($VAR->domain->isWildcard): ?>
ServerAlias "<?php echo $VAR->domain->wildcardName ?>"
<?php else: ?>
ServerAlias "www.<?php echo $VAR->domain->asciiName ?>"
<?php if ($OPT['ipAddress']->isIpV6()): ?>
ServerAlias "ipv6.<?php echo $VAR->domain->asciiName ?>"
<?php else: ?>
ServerAlias "ipv4.<?php echo $VAR->domain->asciiName ?>"
<?php endif; ?>
<?php endif; ?>
<?php foreach ($VAR->domain->webAliases as $alias): ?>
ServerAlias "<?php echo $alias->asciiName ?>"
ServerAlias "www.<?php echo $alias->asciiName ?>"
<?php if ($OPT['ipAddress']->isIpV6()): ?>
ServerAlias "ipv6.<?php echo $alias->asciiName ?>"
<?php else: ?>
ServerAlias "ipv4.<?php echo $alias->asciiName ?>"
<?php endif; ?>
<?php endforeach; ?>
<?php if ($VAR->server->webserver->listenLocalhost): ?>
<?php foreach ($VAR->domain->forwarding->ipAddresses as $ip): ?>
<?php if ($ip->defaultDomainId === $VAR->domain->id): ?>
ServerAlias "<?php echo $ip->defaultServerName ?>"
<?php endif; ?>
<?php endforeach; ?>
<?php endif; ?>
<?php if (!$OPT['ssl'] && $VAR->domain->forwarding->sslRedirect): ?>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L,QSA]
</IfModule>
</VirtualHost>
<?php return; ?>
<?php endif; ?>
<?php echo $VAR->includeTemplate('domain/PCI_compliance.php') ?>
DocumentRoot "<?php echo $VAR->domain->forwarding->vhostDir ?>/httpdocs"
<?php if ($OPT['ssl']): ?>
<?php $sslCertificate = $VAR->server->sni && $VAR->domain->forwarding->sslCertificate ?
$VAR->domain->forwarding->sslCertificate :
$OPT['ipAddress']->sslCertificate; ?>
<?php if ($sslCertificate->ceFilePath): ?>
SSLEngine on
SSLVerifyClient none
SSLCertificateFile <?php echo $sslCertificate->ceFilePath ?>
<?php if ($sslCertificate->caFilePath): ?>
SSLCACertificateFile <?php echo $sslCertificate->caFilePath ?>
<?php endif; ?>
<?php endif; ?>
<?php else: ?>
<IfModule mod_ssl.c>
SSLEngine off
</IfModule>
<?php endif; ?>
<?php echo $VAR->domain->forwarding->extensionsConfigs ?>
</VirtualHost>
<?php if ($OPT['ssl']): ?>
</IfModule>
<?php endif ?>

View File

@@ -1,259 +0,0 @@
<?php
/**
* @var Template_VariableAccessor $VAR
* @var array $OPT
*/
?>
<?php if ($VAR->domain->isSeoRedirectToLanding || $VAR->domain->isSeoRedirectToWww || $VAR->domain->isAliasRedirected): ?>
server {
<?php if ($OPT['ssl'] && $OPT['http3']) : ?>
listen <?php echo $OPT['ipAddress']->escapedAddress . ':' . $OPT['frontendPort'] ?> quic;
add_header Alt-Svc <?php echo '\'h3=":' . $OPT['frontendPort'] . '"; ma=86400\'' ?>;
<?php endif; ?>
listen <?php echo $OPT['ipAddress']->escapedAddress . ':' . $OPT['frontendPort'] . ($OPT['ssl'] ? ' ssl' : '') ?>;
<?php if ($OPT['ssl'] && $OPT['http2']) : ?>
http2 on;
<?php endif; ?>
<?php if ($OPT['ssl']): ?>
<?php $sslCertificate = $VAR->server->sni && $VAR->domain->physicalHosting->sslCertificate ?
$VAR->domain->physicalHosting->sslCertificate :
$OPT['ipAddress']->sslCertificate; ?>
<?php if ($sslCertificate->ceFilePath): ?>
ssl_certificate <?php echo $sslCertificate->ceFilePath ?>;
ssl_certificate_key <?php echo $sslCertificate->ceFilePath ?>;
<?php endif ?>
<?php endif ?>
<?php if ($VAR->domain->isSeoRedirectToLanding) : ?>
server_name www.<?= $VAR->domain->asciiName; ?>;
<?php elseif ($VAR->domain->isSeoRedirectToWww): ?>
server_name <?= $VAR->domain->asciiName; ?>;
<?php endif; ?>
<?php if ($VAR->domain->isAliasRedirected): ?>
<?php foreach ($VAR->domain->webAliases AS $alias): ?>
<?php if ($alias->isSeoRedirect) : ?>
server_name <?= $alias->asciiName; ?>;
server_name www.<?= $alias->asciiName; ?>;
<?php endif; ?>
<?php endforeach; ?>
<?php endif; ?>
location / {
return 301 <?= ($OPT['ssl'] || $VAR->domain->physicalHosting->sslRedirect) ? 'https' : 'http'; ?>://<?php echo $VAR->domain->targetName; ?>$request_uri;
}
<?php if ($VAR->domain->isMailAutodiscoveryEnabled): ?>
<?php echo $VAR->includeTemplate('domain/service/nginxMailAutoConfig.php') ?>
<?php endif ?>
}
<?php endif; ?>
server {
<?php if ($OPT['ssl'] && $OPT['http3']) : ?>
listen <?php echo $OPT['ipAddress']->escapedAddress . ':' . $OPT['frontendPort'] . ' quic' ?>;
add_header Alt-Svc <?php echo '\'h3=":' . $OPT['frontendPort'] . '"; ma=86400\'' ?>;
<?php endif; ?>
listen <?php echo $OPT['ipAddress']->escapedAddress . ':' . $OPT['frontendPort'] .
($OPT['default'] ? ' default_server' : '') . ($OPT['ssl'] ? ' ssl' : '') ?>;
<?php if ($OPT['ssl'] && $OPT['http2']) : ?>
http2 on;
<?php endif; ?>
<?php if (!$VAR->domain->isSeoRedirectToWww): ?>
server_name <?php echo $VAR->domain->asciiName ?>;
<?php endif; ?>
<?php if ($VAR->domain->isWildcard): ?>
server_name ~^<?php echo $VAR->domain->pcreName ?>$;
<?php else: ?>
<?php if (!$VAR->domain->isSeoRedirectToLanding) : ?>
server_name www.<?php echo $VAR->domain->asciiName ?>;
<?php endif; ?>
<?php if ($OPT['ipAddress']->isIpV6()): ?>
server_name ipv6.<?php echo $VAR->domain->asciiName ?>;
<?php else: ?>
server_name ipv4.<?php echo $VAR->domain->asciiName ?>;
<?php endif ?>
<?php endif ?>
<?php if ($VAR->domain->webAliases): ?>
<?php foreach ($VAR->domain->webAliases as $alias): ?>
<?php if (!$alias->isSeoRedirect): ?>
server_name <?php echo $alias->asciiName ?>;
server_name www.<?php echo $alias->asciiName ?>;
<?php endif;?>
<?php endforeach ?>
<?php endif ?>
<?php if ($VAR->domain->previewDomainName): ?>
server_name "<?php echo $VAR->domain->previewDomainName ?>";
<?php endif ?>
<?php if ($OPT['ssl']): ?>
<?php $sslCertificate = $VAR->server->sni && $VAR->domain->physicalHosting->sslCertificate ?
$VAR->domain->physicalHosting->sslCertificate :
$OPT['ipAddress']->sslCertificate; ?>
<?php if ($sslCertificate->ceFilePath): ?>
ssl_certificate <?php echo $sslCertificate->ceFilePath ?>;
ssl_certificate_key <?php echo $sslCertificate->ceFilePath ?>;
<?php endif ?>
<?php endif ?>
<?php if ($VAR->domain->physicalHosting->nginxWebAppFirewallSettings) : ?>
modsecurity_rules_file "<?php echo $VAR->domain->physicalHosting->nginxWebAppFirewallSettingsFile ?>";
<?php endif ?>
<?php if (!$VAR->domain->physicalHosting->proxySettings['nginxProxyMode'] && $VAR->domain->suspended): ?>
location / {
return 503;
}
<?php if ($VAR->domain->physicalHosting->errordocs && !$VAR->domain->physicalHosting->proxySettings['nginxProxyMode']): ?>
<?= $VAR->includeTemplate('domain/service/nginxErrordocs.php'); ?>
<?php endif ?>
}
<?php return ?>
<?php endif ?>
<?php if (!empty($VAR->domain->physicalHosting->proxySettings['nginxClientMaxBodySize'])): ?>
client_max_body_size <?php echo $VAR->domain->physicalHosting->proxySettings['nginxClientMaxBodySize'] ?>;
<?php endif ?>
<?php if ($VAR->domain->isMailAutodiscoveryEnabled): ?>
<?php echo $VAR->includeTemplate('domain/service/nginxMailAutoConfig.php') ?>
<?php endif ?>
access_log "<?php echo $VAR->domain->physicalHosting->logsDir . '/' . ($OPT['ssl'] ? 'proxy_access_ssl_log' : 'proxy_access_log') ?>";
error_log "<?php echo $VAR->domain->physicalHosting->logsDir . '/proxy_error_log' ?>";
<?php if (!$OPT['ssl'] && $VAR->domain->physicalHosting->sslRedirect): ?>
location / {
return 301 https://$host$request_uri;
}
}
<?php return ?>
<?php endif ?>
root "<?php echo $OPT['ssl'] ? $VAR->domain->physicalHosting->httpsDir : $VAR->domain->physicalHosting->httpDir ?>";
<?php if ($OPT['default']): ?>
<?php echo $VAR->includeTemplate('service/nginxSitePreview.php') ?>
<?php endif ?>
<?php echo $VAR->domain->physicalHosting->proxySettings['allowDeny'] ?>
<?=$VAR->includeTemplate('domain/service/nginxCache.php', $OPT)?>
<?php echo $VAR->domain->physicalHosting->nginxExtensionsConfigs ?>
<?php if ($VAR->domain->physicalHosting->errordocs && (!$VAR->domain->physicalHosting->proxySettings['nginxProxyMode'] || ($VAR->domain->active && $VAR->domain->physicalHosting->php && $VAR->domain->physicalHosting->proxySettings['nginxServePhp']))): ?>
<?= $VAR->includeTemplate('domain/service/nginxErrordocs.php'); ?>
<?php endif; ?>
<?php if (!$VAR->domain->physicalHosting->proxySettings['nginxProxyMode']): ?>
location ~ /\.ht {
deny all;
}
<?php endif ?>
<?php if ($VAR->domain->physicalHosting->proxySettings['nginxProxyMode']): ?>
location / {
<?php if ($VAR->domain->physicalHosting->scriptTimeout): ?>
proxy_read_timeout <?php echo min($VAR->domain->physicalHosting->scriptTimeout, 2147483) ?>;
<?php endif ?>
<?php echo $VAR->includeTemplate('domain/service/proxy.php', $OPT) ?>
}
<?php if (!$VAR->domain->physicalHosting->proxySettings['nginxTransparentMode'] && !$VAR->domain->physicalHosting->proxySettings['nginxServeStatic']): ?>
location ^~ /internal-nginx-static-location/ {
alias <?php echo $OPT['documentRoot'] ?>/;
internal;
<?php if ($VAR->domain->physicalHosting->expires && $VAR->domain->physicalHosting->expiresStaticOnly): ?>
expires <?=$VAR->quote($VAR->domain->physicalHosting->expires)?>;
<?php endif ?>
}
<?php endif ?>
<?php endif ?>
<?php if ($VAR->domain->active && $VAR->domain->physicalHosting->hasWebstat): ?>
<?php echo $VAR->includeTemplate('domain/service/nginxWebstatDirectories.php', $OPT) ?>
<?php endif ?>
<?php if ($VAR->domain->active): ?>
<?php if (!$VAR->domain->physicalHosting->proxySettings['nginxProxyMode']): ?>
<?php echo $VAR->includeTemplate('domain/service/nginxProtectedDirectories.php', $OPT) ?>
<?php else: ?>
<?php echo $VAR->includeTemplate('domain/service/nginxProtectedDirectoriesProxy.php', $OPT) ?>
<?php endif ?>
<?php endif ?>
<?php if ($VAR->domain->active && $VAR->domain->physicalHosting->proxySettings['nginxServeStatic']): ?>
location @fallback {
<?php if ($VAR->domain->physicalHosting->scriptTimeout): ?>
proxy_read_timeout <?php echo min($VAR->domain->physicalHosting->scriptTimeout, 2147483) ?>;
<?php endif ?>
<?php if ($VAR->domain->physicalHosting->proxySettings['nginxProxyMode']): ?>
<?php echo $VAR->includeTemplate('domain/service/proxy.php', $OPT) ?>
<?php else: ?>
return 404;
<?php endif ?>
}
location ~ ^/(.*\.(<?php echo $VAR->domain->physicalHosting->proxySettings['nginxStaticExtensions'] ?>))$ {
try_files $uri @fallback;
<?php if ($VAR->domain->physicalHosting->expires && $VAR->domain->physicalHosting->expiresStaticOnly): ?>
expires <?=$VAR->quote($VAR->domain->physicalHosting->expires)?>;
<?php endif ?>
}
<?php endif ?>
<?php if ($VAR->domain->active && $VAR->domain->physicalHosting->php && $VAR->domain->physicalHosting->proxySettings['nginxServePhp']): ?>
location ~ ^/~(.+?)(/.*?\.php)(/.*)?$ {
<?php if ($VAR->domain->physicalHosting->scriptTimeout): ?>
fastcgi_read_timeout <?php echo min($VAR->domain->physicalHosting->scriptTimeout, 2147483) ?>;
<?php endif ?>
alias <?php echo $VAR->domain->physicalHosting->webUsersDir ?>/$1/$2;
<?php echo $VAR->includeTemplate('domain/service/fpm.php', $OPT) ?>
}
<?php if ($VAR->domain->physicalHosting->proxySettings['nginxProxyMode']): ?>
location ~ ^/~(.+?)(/.*)?$ {
<?php if ($VAR->domain->physicalHosting->scriptTimeout): ?>
proxy_read_timeout <?php echo min($VAR->domain->physicalHosting->scriptTimeout, 2147483) ?>;
<?php endif ?>
<?php echo $VAR->includeTemplate('domain/service/proxy.php', $OPT) ?>
}
<?php endif ?>
location ~ \.php(/.*)?$ {
<?php if ($VAR->domain->physicalHosting->scriptTimeout): ?>
fastcgi_read_timeout <?php echo min($VAR->domain->physicalHosting->scriptTimeout, 2147483) ?>;
<?php endif ?>
<?php echo $VAR->includeTemplate('domain/service/fpm.php', $OPT) ?>
}
<?php if ($VAR->domain->physicalHosting->directoryIndex && !$VAR->domain->physicalHosting->proxySettings['nginxProxyMode']): ?>
index <?=$VAR->quote($VAR->domain->physicalHosting->directoryIndex)?>;
<?php endif ?>
<?php endif ?>
<?php if ($VAR->domain->physicalHosting->restrictFollowSymLinks && $VAR->server->nginx->safeSymlinks): ?>
disable_symlinks if_not_owner "from=<?=$VAR->escape($VAR->domain->physicalHosting->vhostDir)?>";
<?php elseif ($VAR->domain->physicalHosting->restrictFollowSymLinks): ?>
disable_symlinks if_not_owner from=$document_root;
<?php endif ?>
<?php if ($VAR->domain->physicalHosting->expires && !$VAR->domain->physicalHosting->expiresStaticOnly): ?>
expires <?=$VAR->quote($VAR->domain->physicalHosting->expires)?>;
<?php endif ?>
<?php foreach ((array)$VAR->domain->physicalHosting->headers as list($name, $value)): ?>
add_header <?=$VAR->quote([$name, $value])?>;
<?php endforeach ?>
<?php if ($VAR->server->xPoweredByHeader) : ?>
add_header X-Powered-By PleskLin;
<?php endif ?>
<?php if (is_file($VAR->domain->physicalHosting->customNginxConfigFile)) : ?>
include "<?php echo $VAR->domain->physicalHosting->customNginxConfigFile ?>";
<?php endif ?>
}

View File

@@ -1,94 +0,0 @@
<?php
/**
* @var Template_VariableAccessor $VAR
* @var array $OPT
*/
?>
server {
<?php if ($OPT['ssl'] && $OPT['http3']) : ?>
listen <?php echo $OPT['ipAddress']->escapedAddress . ':' . $OPT['frontendPort'] ?> quic;
add_header Alt-Svc <?php echo '\'h3=":' . $OPT['frontendPort'] . '"; ma=86400\'' ?>;
<?php endif; ?>
listen <?php echo $OPT['ipAddress']->escapedAddress . ':' . $OPT['frontendPort'] .
($OPT['default'] ? ' default_server' : '') . ($OPT['ssl'] ? ' ssl' : '') ?>;
<?php if ($OPT['ssl'] && $OPT['http2']) : ?>
http2 on;
<?php endif; ?>
server_name <?php echo $VAR->domain->asciiName ?>;
<?php if ($VAR->domain->isWildcard): ?>
server_name <?php echo $VAR->domain->wildcardName ?>;
<?php else: ?>
server_name www.<?php echo $VAR->domain->asciiName ?>;
<?php endif ?>
<?php if (!$VAR->domain->isWildcard): ?>
<?php if ($OPT['ipAddress']->isIpV6()): ?>
server_name ipv6.<?php echo $VAR->domain->asciiName ?>;
<?php else: ?>
server_name ipv4.<?php echo $VAR->domain->asciiName ?>;
<?php endif ?>
<?php endif ?>
<?php foreach ($VAR->domain->webAliases as $alias): ?>
server_name <?php echo $alias->asciiName ?>;
server_name www.<?php echo $alias->asciiName ?>;
<?php if ($OPT['ipAddress']->isIpV6()): ?>
server_name ipv6.<?php echo $alias->asciiName ?>;
<?php else: ?>
server_name ipv4.<?php echo $alias->asciiName ?>;
<?php endif ?>
<?php endforeach ?>
<?php if ($OPT['ssl']): ?>
<?php $sslCertificate = $VAR->server->sni && $VAR->domain->forwarding->sslCertificate ?
$VAR->domain->forwarding->sslCertificate :
$OPT['ipAddress']->sslCertificate; ?>
<?php if ($sslCertificate->ceFilePath): ?>
ssl_certificate <?php echo $sslCertificate->ceFilePath ?>;
ssl_certificate_key <?php echo $sslCertificate->ceFilePath ?>;
<?php endif ?>
<?php endif ?>
<?php if (!$OPT['ssl'] && $VAR->domain->forwarding->sslRedirect): ?>
location / {
return 301 https://$host$request_uri;
}
}
<?php return ?>
<?php endif ?>
<?php if ($OPT['default']): ?>
<?php echo $VAR->includeTemplate('service/nginxSitePreview.php') ?>
<?php endif ?>
<?php echo $VAR->domain->forwarding->nginxExtensionsConfigs ?>
location / {
<?php if ($OPT['ssl']): ?>
proxy_pass https://127.0.0.1:<?php echo $OPT['backendPort'] ?>;
proxy_hide_header upgrade;
proxy_ssl_server_name on;
<?php if ($VAR->server->webserver->listenLocalhost && ($OPT['default'] ?? false)): ?>
proxy_ssl_name $ip_default_host;
<?php else: ?>
proxy_ssl_name $host;
<?php endif ?>
proxy_ssl_session_reuse off;
<?php else: ?>
proxy_pass http://127.0.0.1:<?php echo $OPT['backendPort'] ?>;
<?php endif ?>
<?php if ($VAR->server->webserver->listenLocalhost && ($OPT['default'] ?? false)): ?>
proxy_set_header Host $ip_default_host;
<?php else: ?>
proxy_set_header Host $host;
<?php endif ?>
proxy_set_header X-Forwarded-Http-Host $host:$server_port;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
access_log off;
}
<?php if ($VAR->server->xPoweredByHeader) : ?>
add_header X-Powered-By PleskLin;
<?php endif ?>
}

View File

@@ -1,12 +0,0 @@
<?php
/**
* @var Template_VariableAccessor $VAR
* @var array $OPT
*/
?>
Alias /error_docs <?php echo $VAR->webspace->vhostDir . '/' . $VAR->domain->physicalHosting->errorDocsDir ?>
<?php foreach ($VAR->domain->physicalHosting->errorDocsByCodes as $errCode => $errFile): ?>
ErrorDocument <?php echo $errCode?> /<?php echo $VAR->domain->physicalHosting->errorDocsDir . '/' . $errFile ?>
<?php endforeach; ?>

View File

@@ -1,18 +0,0 @@
<?php
/**
* @var Template_VariableAccessor $VAR
* @var array $OPT
*/
?>
fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
try_files $uri $fastcgi_script_name =404;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_pass "<?php echo $VAR->domain->physicalHosting->fpmSocket ?>";
include /etc/nginx/fastcgi.conf;
<?php if (($OPT['ssl'] ?? false) && ($OPT['http3'] ?? false)): ?>
fastcgi_param HTTP_HOST $host;
<?php endif ?>
<?php if ($OPT['nginxCacheEnabled'] ?? true): ?>
<?=$VAR->includeTemplate('domain/service/nginxCacheFastCgi.php', $OPT)?>
<?php endif ?>

View File

@@ -1,21 +0,0 @@
<?php
/**
* @var Template_VariableAccessor $VAR
* @var array $OPT
*/
?>
# mailconfig
<IfModule mod_proxy_http.c>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/autodiscover/autodiscover\.xml$ [NC,OR]
RewriteCond %{REQUEST_URI} ^(/\.well-known/autoconfig)?/mail/config\-v1\.1\.xml$ [NC,OR]
RewriteCond %{REQUEST_URI} ^/email\.mobileconfig$ [NC]
RewriteRule ^(.*)$ <?= $VAR->panel->mailAutoConfigUrl ?>/mailconfig/ [P,QSA,L,E=REQUEST_URI:%{REQUEST_URI},E=HOST:%{HTTP_HOST}]
</IfModule>
<Proxy "<?= $VAR->panel->mailAutoConfigUrl ?>/mailconfig/">
RequestHeader set X-Host "%{HOST}e"
RequestHeader set X-Request-URI "%{REQUEST_URI}e"
</Proxy>
</IfModule>
# mailconfig

View File

@@ -1,27 +0,0 @@
<?php
/**
* @var Template_VariableAccessor $VAR
* @var array $OPT
*/
?>
<?php if ($VAR->domain->physicalHosting->proxySettings['nginxCacheEnabled']): ?>
add_header X-Cache-Status $upstream_cache_status;
set $no_cache "";
<?php if (!empty($VAR->domain->physicalHosting->proxySettings['nginxCacheBypassLocations'])): ?>
if ($request_uri ~* <?=$VAR->pregQuote($VAR->domain->physicalHosting->proxySettings['nginxCacheBypassLocations'])?>) {
set $no_cache 1;
}
<?php endif ?>
set $cache_cookie $http_cookie;
<?php foreach ($VAR->domain->physicalHosting->proxySettings['nginxCacheCookies'] as $cookie): ?>
if ($cache_cookie ~ "(.*)(?:^|;)\s*<?=preg_quote($cookie)?>=[^;]+(?:$|;)(.*)") {
set $cache_cookie $1$2;
}
<?php endforeach ?>
if ($cache_cookie !~ "^\s*$") {
set $no_cache 1;
}
<?php endif ?>

View File

@@ -1,33 +0,0 @@
<?php
/**
* @var Template_VariableAccessor $VAR
* @var array $OPT
*/
?>
<?php if ($VAR->domain->physicalHosting->proxySettings['nginxCacheEnabled']): ?>
fastcgi_cache_key <?=$VAR->quote($VAR->domain->physicalHosting->proxySettings['nginxCacheKey'])?>;
fastcgi_no_cache <?=join(' ', array_filter([
'$no_cache',
$VAR->domain->physicalHosting->proxySettings['nginxCacheBypassHeaderNocache'] ? '$http_pragma' : '',
$VAR->domain->physicalHosting->proxySettings['nginxCacheBypassHeaderAuth'] ? '$http_authorization' : '',
$VAR->domain->physicalHosting->proxySettings['nginxCacheBypassGetNocache'] ? '$arg_nocache' : '',
]))?>;
fastcgi_cache_bypass <?=join(' ', array_filter([
'$no_cache',
$VAR->domain->physicalHosting->proxySettings['nginxCacheBypassHeaderNocache'] ? '$http_pragma' : '',
$VAR->domain->physicalHosting->proxySettings['nginxCacheBypassHeaderAuth'] ? '$http_authorization' : '',
$VAR->domain->physicalHosting->proxySettings['nginxCacheBypassGetNocache'] ? '$arg_nocache' : '',
]))?>;
fastcgi_cache <?="{$VAR->domain->asciiName}_fastcgi"?>;
fastcgi_cache_valid <?=$VAR->quote($VAR->domain->physicalHosting->proxySettings['nginxCacheTimeout'])?>;
fastcgi_cache_use_stale <?=join(' ', array_merge(
$VAR->domain->physicalHosting->proxySettings['nginxCacheUseStale5xx'] ? ['http_500', 'http_503'] : [],
$VAR->domain->physicalHosting->proxySettings['nginxCacheUseStale4xx'] ? ['http_403', 'http_404'] : [],
$VAR->domain->physicalHosting->proxySettings['nginxCacheUseStaleUpdating'] ? ['updating'] : []
) ?: ['off'])?>;
<?php if ($VAR->domain->physicalHosting->proxySettings['nginxCacheUseStaleUpdating']): ?>
fastcgi_cache_background_update on;
<?php endif ?>
<?php endif ?>

View File

@@ -1,25 +0,0 @@
<?php
/**
* @var Template_VariableAccessor $VAR
* @var array $OPT
*/
?>
<?php if ($VAR->domain->physicalHosting->proxySettings['nginxCacheEnabled']): ?>
<?php if ($VAR->domain->physicalHosting->proxySettings['nginxProxyMode']): ?>
proxy_cache_path <?=(
"{$VAR->domain->physicalHosting->proxySettings['nginxCacheDir']}/{$VAR->domain->asciiName}_proxy" .
" levels=1:2" .
" keys_zone={$VAR->domain->asciiName}_proxy:5m" .
" max_size=" . $VAR->domain->physicalHosting->proxySettings['nginxCacheSize']
)?>;
<?php endif ?>
<?php if ($VAR->domain->physicalHosting->proxySettings['nginxServePhp']): ?>
fastcgi_cache_path <?=(
"{$VAR->domain->physicalHosting->proxySettings['nginxCacheDir']}/{$VAR->domain->asciiName}_fastcgi" .
" levels=1:2" .
" keys_zone={$VAR->domain->asciiName}_fastcgi:5m" .
" max_size=" . $VAR->domain->physicalHosting->proxySettings['nginxCacheSize']
)?>;
<?php endif ?>
<?php endif ?>

View File

@@ -1,33 +0,0 @@
<?php
/**
* @var Template_VariableAccessor $VAR
* @var array $OPT
*/
?>
<?php if ($VAR->domain->physicalHosting->proxySettings['nginxCacheEnabled']): ?>
proxy_cache_key <?=$VAR->quote($VAR->domain->physicalHosting->proxySettings['nginxCacheKey'])?>;
proxy_no_cache <?=join(' ', array_filter([
'$no_cache',
$VAR->domain->physicalHosting->proxySettings['nginxCacheBypassHeaderNocache'] ? '$http_pragma' : '',
$VAR->domain->physicalHosting->proxySettings['nginxCacheBypassHeaderAuth'] ? '$http_authorization' : '',
$VAR->domain->physicalHosting->proxySettings['nginxCacheBypassGetNocache'] ? '$arg_nocache' : '',
]))?>;
proxy_cache_bypass <?=join(' ', array_filter([
'$no_cache',
$VAR->domain->physicalHosting->proxySettings['nginxCacheBypassHeaderNocache'] ? '$http_pragma' : '',
$VAR->domain->physicalHosting->proxySettings['nginxCacheBypassHeaderAuth'] ? '$http_authorization' : '',
$VAR->domain->physicalHosting->proxySettings['nginxCacheBypassGetNocache'] ? '$arg_nocache' : '',
]))?>;
proxy_cache <?="{$VAR->domain->asciiName}_proxy"?>;
proxy_cache_valid <?=$VAR->quote($VAR->domain->physicalHosting->proxySettings['nginxCacheTimeout'])?>;
proxy_cache_use_stale <?=join(' ', array_merge(
$VAR->domain->physicalHosting->proxySettings['nginxCacheUseStale5xx'] ? ['http_500', 'http_502', 'http_503', 'http_504'] : [],
$VAR->domain->physicalHosting->proxySettings['nginxCacheUseStale4xx'] ? ['http_403', 'http_404'] : [],
$VAR->domain->physicalHosting->proxySettings['nginxCacheUseStaleUpdating'] ? ['updating'] : []
) ?: ['off'])?>;
<?php if ($VAR->domain->physicalHosting->proxySettings['nginxCacheUseStaleUpdating']): ?>
proxy_cache_background_update on;
<?php endif ?>
<?php endif ?>

View File

@@ -1,13 +0,0 @@
<?php
/**
* @var Template_VariableAccessor $VAR
* @var array $OPT
*/
?>
<?php foreach ($VAR->domain->physicalHosting->errorDocsByCodes as $errCode => $errFile): ?>
error_page <?= $errCode; ?> <?= $VAR->quote('/' . $VAR->domain->physicalHosting->errorDocsDir . '/' . $errFile); ?>;
<?php endforeach; ?>
location ^~ /<?= $VAR->domain->physicalHosting->errorDocsDir; ?> {
root <?= $VAR->quote($VAR->domain->physicalHosting->vhostDir); ?>;
}

View File

@@ -1,26 +0,0 @@
<?php
/**
* @var Template_VariableAccessor $VAR
* @var array $OPT
*/
?>
# mailconfig
location ~* ^/autodiscover/autodiscover\.xml$ {
try_files $uri @mad;
}
location ~* ^(/\.well-known/autoconfig)?/mail/config\-v1\.1\.xml$ {
try_files $uri @mad;
}
location ~* ^/email\.mobileconfig$ {
try_files $uri @mad;
}
location @mad {
rewrite ^(.*)$ /mailconfig/ break;
proxy_pass <?= $VAR->panel->mailAutoConfigUrl ?>;
proxy_set_header X-Host $host;
proxy_set_header X-Request-URI $request_uri;
}
# mailconfig

View File

@@ -1,30 +0,0 @@
<?php
/**
* @var Template_VariableAccessor $VAR
* @var array $OPT
*/
?>
<?php foreach(($OPT['ssl'] ? $VAR->domain->protectedDirectories->sslDirectories : $VAR->domain->protectedDirectories->nonSslDirectories) as $directory): ?>
<?php if ('plesk-stat' == $directory['relativePath']): ?>
<?php continue ?>
<?php endif ?>
<?php $dir = trim($directory['relativePath'], '/') ?>
location ~ <?=strlen($dir) > 0 ? $VAR->encodeDirective("^/" . $VAR->pregQuote($dir) . "($|/)") : "^/"?> {
auth_basic "<?php echo strlen($directory['realm']) > 0 ? $directory['realm'] : ' ' ?>";
auth_basic_user_file "<?php echo $directory['authFile'] ?>";
<?php if ($VAR->domain->physicalHosting->php && $VAR->domain->physicalHosting->proxySettings['nginxServePhp']): ?>
location ~ \.php(/.*)?$ {
<?php echo $VAR->includeTemplate('domain/service/fpm.php', $OPT) ?>
}
<?php if ($VAR->domain->physicalHosting->directoryIndex): ?>
location ~ /$ {
index <?=$VAR->quote($VAR->domain->physicalHosting->directoryIndex)?>;
}
<?php endif ?>
<?php endif ?>
}
<?php endforeach ?>

View File

@@ -1,26 +0,0 @@
<?php
/**
* @var Template_VariableAccessor $VAR
* @var array $OPT
*/
?>
<?php foreach (($OPT['ssl'] ? $VAR->domain->protectedDirectories->sslDirectories : $VAR->domain->protectedDirectories->nonSslDirectories) as $directory) : ?>
<?php if ('plesk-stat' == $directory['relativePath']) : ?>
<?php continue ?>
<?php endif ?>
<?php $dir = trim($directory['relativePath'], '/') ?>
location ~ <?=strlen($dir) > 0 ? $VAR->encodeDirective("^/" . $VAR->pregQuote($dir) . "($|/)") : "^/"?> {
auth_basic "<?php echo strlen($directory['realm']) > 0 ? $directory['realm'] : ' ' ?>";
auth_basic_user_file "<?php echo $directory['authFile'] ?>";
<?php if ($VAR->domain->physicalHosting->proxySettings['nginxServeStatic']) : ?>
location ~ ^/(.*\.(<?php echo $VAR->domain->physicalHosting->proxySettings['nginxStaticExtensions'] ?>))$ {
try_files $uri @fallback;
<?php if ($VAR->domain->physicalHosting->expires && $VAR->domain->physicalHosting->expiresStaticOnly) : ?>
expires <?=$VAR->quote($VAR->domain->physicalHosting->expires)?>;
<?php endif ?>
}
<?php endif ?>
<?php echo $VAR->includeTemplate('domain/service/proxy.php', $OPT); ?>
}
<?php endforeach ?>

View File

@@ -1,27 +0,0 @@
<?php
/**
* @var Template_VariableAccessor $VAR
* @var array $OPT
*/
?>
<?php if ($VAR->domain->isSeoRedirectToLanding) : ?>
if ($host ~* ^www\.<?php echo str_replace('.', '\\.', $VAR->domain->asciiName) ?>$) {
rewrite ^(.*)$ <?php echo $OPT['ssl'] ? 'https' : 'http'; ?>://<?php echo $VAR->domain->asciiName ?>$1 permanent;
}
<?php elseif ($VAR->domain->isSeoRedirectToWww): ?>
if ($host ~* ^<?php echo str_replace('.', '\\.', $VAR->domain->asciiName) ?>$) {
rewrite ^(.*)$ <?php echo $OPT['ssl'] ? 'https' : 'http'; ?>://www.<?php echo $VAR->domain->asciiName ?>$1 permanent;
}
<?php endif; ?>
<?php if ($VAR->domain->isAliasRedirected): ?>
<?php foreach ($VAR->domain->webAliases AS $alias): ?>
<?php if ($alias->isSeoRedirect) : ?>
if ($host ~* ^<?php echo str_replace('.', '\\.', $alias->asciiName) ?>$) {
rewrite ^(.*)$ <?php echo $OPT['ssl'] ? 'https' : 'http'; ?>://<?php echo $VAR->domain->targetName; ?>$1 permanent;
}
if ($host ~* ^www\.<?php echo str_replace('.', '\\.', $alias->asciiName) ?>$) {
rewrite ^(.*)$ <?php echo $OPT['ssl'] ? 'https' : 'http'; ?>://<?php echo $VAR->domain->targetName; ?>$1 permanent;
}
<?php endif; ?>
<?php endforeach; ?>
<?php endif; ?>

View File

@@ -1,39 +0,0 @@
<?php
/**
* @var Template_VariableAccessor $VAR
* @var array $OPT
*/
?>
location ~ ^/(plesk-stat|awstats-icon|webstat|webstat-ssl|ftpstat|anon_ftpstat) {
<?php if ($VAR->domain->physicalHosting->proxySettings['nginxProxyMode']): ?>
<?=$VAR->includeTemplate('domain/service/proxy.php', $OPT + ['nginxCacheEnabled' => false])?>
<?php else: ?>
<?php if ($OPT['ssl']): ?>
<?php
$directories = array_filter($VAR->domain->protectedDirectories->sslDirectories, function($directory) {
return 'plesk-stat' == $directory['relativePath'];
});
$directory = reset($directories);
?>
<?php if ($directory): ?>
auth_basic "<?php echo strlen($directory['realm']) > 0 ? $directory['realm'] : ' ' ?>";
auth_basic_user_file "<?php echo $directory['authFile'] ?>";
<?php endif ?>
autoindex on;
location ~ ^/plesk-stat(.*) {
alias <?php echo $VAR->domain->physicalHosting->statisticsDir ?>/$1;
}
location ~ ^/awstats-icon(.*) {
alias <?php echo $VAR->server->awstats->iconsDir ?>/$1;
}
location ~ ^/(.*) {
alias <?php echo $VAR->domain->physicalHosting->statisticsDir ?>/$1;
}
<?php else: ?>
return 301 https://$host$request_uri;
<?php endif ?>
<?php endif ?>
}

View File

@@ -1,8 +0,0 @@
<?php foreach(($OPT['ssl'] ? $VAR->domain->protectedDirectories->sslDirectories : $VAR->domain->protectedDirectories->nonSslDirectories) as $directory): ?>
<Directory "<?php echo $directory['directory'] ?>">
AuthType Basic
AuthName "<?php echo 0 < strlen($directory['realm']) ? $directory['realm'] : ' '?>"
AuthUserFile "<?php echo $directory['authFile'] ?>"
require valid-user
</Directory>
<?php endforeach; ?>

View File

@@ -1,34 +0,0 @@
<?php
/**
* @var Template_VariableAccessor $VAR
* @var array $OPT
*/
?>
<?php if ($OPT['ssl']): ?>
proxy_pass https://<?php echo $OPT['ipAddress']->proxyEscapedAddress . ':' . $OPT['backendPort'] ?>;
proxy_hide_header upgrade;
proxy_ssl_server_name on;
<?php if ($VAR->server->webserver->listenLocalhost && ($OPT['default'] ?? false)): ?>
proxy_ssl_name $ip_default_host;
<?php else: ?>
proxy_ssl_name $host;
<?php endif ?>
proxy_ssl_session_reuse off;
<?php else: ?>
proxy_pass http://<?php echo $OPT['ipAddress']->proxyEscapedAddress . ':' . $OPT['backendPort'] ?>;
<?php endif ?>
<?php if ($VAR->server->webserver->listenLocalhost && ($OPT['default'] ?? false)): ?>
proxy_set_header Host $ip_default_host;
<?php else: ?>
proxy_set_header Host $host;
<?php endif ?>
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
<?php if (!$VAR->domain->physicalHosting->proxySettings['nginxTransparentMode'] && !$VAR->domain->physicalHosting->proxySettings['nginxServeStatic']): ?>
proxy_set_header X-Accel-Internal /internal-nginx-static-location;
<?php endif ?>
access_log off;
<?php if ($OPT['nginxCacheEnabled'] ?? true): ?>
<?=$VAR->includeTemplate('domain/service/nginxCacheProxy.php', $OPT)?>
<?php endif ?>

View File

@@ -1,31 +0,0 @@
<?php
/**
* @var Template_VariableAccessor $VAR
* @var array $OPT
*/
?>
<?php if ($VAR->domain->isSeoRedirectToLanding) : ?>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.<?php echo str_replace('.', '\\.', $VAR->domain->asciiName) ?>$ [NC]
RewriteRule ^(.*)$ <?php echo $OPT['ssl'] ? 'https' : 'http'; ?>://<?php echo $VAR->domain->asciiName ?>$1 [L,R=301]
</IfModule>
<?php elseif ($VAR->domain->isSeoRedirectToWww): ?>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} ^<?php echo str_replace('.', '\\.', $VAR->domain->asciiName) ?>$ [NC]
RewriteRule ^(.*)$ <?php echo $OPT['ssl'] ? 'https' : 'http'; ?>://www.<?php echo $VAR->domain->asciiName ?>$1 [L,R=301]
</IfModule>
<?php endif; ?>
<?php if ($VAR->domain->isAliasRedirected): ?>
<IfModule mod_rewrite.c>
RewriteEngine On
<?php foreach ($VAR->domain->webAliases AS $alias): ?>
<?php if ($alias->isSeoRedirect) : ?>
RewriteCond %{HTTP_HOST} ^<?php echo str_replace('.', '\\.', $alias->asciiName) ?>$ [NC,OR]
RewriteCond %{HTTP_HOST} ^www\.<?php echo str_replace('.', '\\.', $alias->asciiName) ?>$ [NC]
RewriteRule ^(.*)$ <?php echo $OPT['ssl'] ? 'https' : 'http'; ?>://<?php echo $VAR->domain->targetName; ?>$1 [L,R=301]
<?php endif; ?>
<?php endforeach; ?>
</IfModule>
<?php endif; ?>

View File

@@ -1,7 +0,0 @@
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{ENV:REDIRECT_STATUS} !=503
RewriteCond %{REQUEST_URI} !\.(jpe?g?|png|gif|ico|svg|css)$ [NC]
RewriteCond %{REQUEST_URI} !robots\.txt$ [NC]
RewriteRule ^ - [L,R=503]
</IfModule>

View File

@@ -1,73 +0,0 @@
<?php
/**
* @var Template_VariableAccessor $VAR
* @var array $OPT
*/
?>
<?php if ($OPT['ssl']): ?>
<IfModule mod_ssl.c>
<?php endif; ?>
<VirtualHost <?php echo $OPT['ipAddress']->escapedAddress?>:<?php echo $OPT['ssl'] ? $VAR->server->webserver->httpsPort : $VAR->server->webserver->httpPort ?> <?php echo ($VAR->server->webserver->proxyActive && $OPT['ipAddress']->address !== '127.0.0.1') ? "127.0.0.1:" . ($OPT['ssl'] ? $VAR->server->webserver->httpsPort : $VAR->server->webserver->httpPort) : ''; ?>>
ServerName "<?php echo $VAR->domain->asciiName ?>"
<?php if ($VAR->domain->isWildcard): ?>
ServerAlias "<?php echo $VAR->domain->wildcardName ?>"
<?php else: ?>
ServerAlias "www.<?php echo $VAR->domain->asciiName ?>"
<?php if ($OPT['ipAddress']->isIpV6()): ?>
ServerAlias "ipv6.<?php echo $VAR->domain->asciiName ?>"
<?php else: ?>
ServerAlias "ipv4.<?php echo $VAR->domain->asciiName ?>"
<?php endif; ?>
<?php endif; ?>
<?php foreach ($VAR->domain->webAliases as $alias): ?>
ServerAlias "<?php echo $alias->asciiName ?>"
ServerAlias "www.<?php echo $alias->asciiName ?>"
<?php if ($OPT['ipAddress']->isIpV6()): ?>
ServerAlias "ipv6.<?php echo $alias->asciiName ?>"
<?php else: ?>
ServerAlias "ipv4.<?php echo $alias->asciiName ?>"
<?php endif; ?>
<?php endforeach; ?>
<?php if ($VAR->server->webserver->listenLocalhost): ?>
<?php foreach ($VAR->domain->forwarding->ipAddresses as $ip): ?>
<?php if ($ip->defaultDomainId === $VAR->domain->id): ?>
ServerAlias "<?php echo $ip->defaultServerName ?>"
<?php endif; ?>
<?php endforeach; ?>
<?php endif; ?>
<?php echo $VAR->includeTemplate('domain/PCI_compliance.php') ?>
<?php if ($OPT['ssl']): ?>
<?php $sslCertificate = $VAR->server->sni && $VAR->domain->forwarding->sslCertificate ?
$VAR->domain->forwarding->sslCertificate :
$OPT['ipAddress']->sslCertificate; ?>
<?php if ($sslCertificate->ceFilePath): ?>
SSLEngine on
SSLVerifyClient none
SSLCertificateFile <?php echo $sslCertificate->ceFilePath ?>
<?php if ($sslCertificate->caFilePath): ?>
SSLCACertificateFile <?php echo $sslCertificate->caFilePath ?>
<?php endif; ?>
<?php endif; ?>
<?php else: ?>
<IfModule mod_ssl.c>
SSLEngine off
</IfModule>
<?php endif; ?>
<?php if (302 == $VAR->domain->forwarding->redirectHttpCode): ?>
RedirectTemp / "<?php echo $VAR->domain->forwarding->redirectUrl ?>"
<?php else: ?>
RedirectPermanent / "<?php echo $VAR->domain->forwarding->redirectUrl ?>"
<?php endif; ?>
<?php echo $VAR->domain->forwarding->extensionsConfigs ?>
</VirtualHost>
<?php if ($OPT['ssl']): ?>
</IfModule>
<?php endif ?>

View File

@@ -1,50 +0,0 @@
<?php
echo AUTOGENERATED_CONFIGS;
/** @var Template_VariableAccessor $VAR */
if (!$VAR->domain->active) {
echo "# Domain is disabled or suspended\n";
return;
}
$ipAddresses = $VAR->server->webserver->listenLocalhost ?
[$VAR->domain->forwarding->loopbackIpAddress] :
$VAR->domain->forwarding->ipAddresses;
if ($VAR->domain->forwarding->ssl) {
foreach ($ipAddresses as $ipAddress) {
if ($ipAddress->defaultDomainId != $VAR->domain->id) {
if ($VAR->domain->hasStandardForwarding) {
echo $VAR->includeTemplate('domain/standardForwarding.php', [
'ssl' => true,
'serverAdmin' => $VAR->domain->client->email,
'ipAddress' => $ipAddress,
]);
} elseif ($VAR->domain->hasFrameForwarding) {
echo $VAR->includeTemplate('domain/frameForwarding.php', [
'ssl' => true,
'serverAdmin' => $VAR->domain->client->email,
'ipAddress' => $ipAddress,
]);
}
}
}
}
foreach ($ipAddresses as $ipAddress) {
if ($ipAddress->defaultDomainId != $VAR->domain->id) {
if ($VAR->domain->hasStandardForwarding) {
echo $VAR->includeTemplate('domain/standardForwarding.php', [
'ssl' => false,
'serverAdmin' => $VAR->domain->client->email,
'ipAddress' => $ipAddress,
]);
} elseif ($VAR->domain->hasFrameForwarding) {
echo $VAR->includeTemplate('domain/frameForwarding.php', [
'ssl' => false,
'serverAdmin' => $VAR->domain->client->email,
'ipAddress' => $ipAddress,
]);
}
}
}

View File

@@ -1,50 +0,0 @@
<?php
echo AUTOGENERATED_CONFIGS;
/** @var Template_VariableAccessor $VAR */
if (!$VAR->domain->active) {
echo "# Domain is disabled or suspended\n";
return;
}
$ipAddresses = $VAR->server->webserver->listenLocalhost ?
[$VAR->domain->forwarding->loopbackIpAddress] :
$VAR->domain->forwarding->ipAddresses;
if ($VAR->domain->forwarding->ssl) {
foreach ($ipAddresses as $ipAddress) {
if ($ipAddress->defaultDomainId == $VAR->domain->id) {
if ($VAR->domain->hasStandardForwarding) {
echo $VAR->includeTemplate('domain/standardForwarding.php', [
'ssl' => true,
'serverAdmin' => $VAR->domain->client->email,
'ipAddress' => $ipAddress,
]);
} elseif ($VAR->domain->hasFrameForwarding) {
echo $VAR->includeTemplate('domain/frameForwarding.php', [
'ssl' => true,
'serverAdmin' => $VAR->domain->client->email,
'ipAddress' => $ipAddress,
]);
}
}
}
}
foreach ($ipAddresses as $ipAddress) {
if ($ipAddress->defaultDomainId == $VAR->domain->id) {
if ($VAR->domain->hasStandardForwarding) {
echo $VAR->includeTemplate('domain/standardForwarding.php', [
'ssl' => false,
'serverAdmin' => $VAR->domain->client->email,
'ipAddress' => $ipAddress,
]);
} elseif ($VAR->domain->hasFrameForwarding) {
echo $VAR->includeTemplate('domain/frameForwarding.php', [
'ssl' => false,
'serverAdmin' => $VAR->domain->client->email,
'ipAddress' => $ipAddress,
]);
}
}
}

View File

@@ -1,39 +0,0 @@
<?php
echo AUTOGENERATED_CONFIGS;
/** @var Template_VariableAccessor $VAR */
if ($VAR->domain->disabled) {
echo "# Domain is disabled\n";
return;
}
echo ALLOW_VHOSTCONF;
echo '#' . $VAR->domain->physicalHosting->customConfigFile . "\n";
if ($VAR->domain->physicalHosting->ssl) {
echo '#' . $VAR->domain->physicalHosting->customSslConfigFile . "\n";
}
$ipAddresses = $VAR->server->webserver->listenLocalhost ?
[$VAR->domain->physicalHosting->loopbackIpAddress] :
$VAR->domain->physicalHosting->ipAddresses;
if ($VAR->domain->physicalHosting->ssl) {
foreach ($ipAddresses as $ipAddress) {
if ($ipAddress->defaultDomainId !== $VAR->domain->id) {
echo $VAR->includeTemplate('domain/domainVirtualHost.php', [
'ssl' => true,
'ipAddress' => $ipAddress,
]);
}
}
}
foreach ($ipAddresses as $ipAddress) {
if ($ipAddress->defaultDomainId !== $VAR->domain->id) {
echo $VAR->includeTemplate('domain/domainVirtualHost.php', [
'ssl' => false,
'ipAddress' => $ipAddress,
]);
}
}

View File

@@ -1,39 +0,0 @@
<?php
echo AUTOGENERATED_CONFIGS;
/** @var Template_VariableAccessor $VAR */
if ($VAR->domain->disabled) {
echo "# Domain is disabled\n";
return;
}
echo ALLOW_VHOSTCONF;
echo '#' . $VAR->domain->physicalHosting->customConfigFile . "\n";
if ($VAR->domain->physicalHosting->ssl) {
echo '#' . $VAR->domain->physicalHosting->customSslConfigFile . "\n";
}
$ipAddresses = $VAR->server->webserver->listenLocalhost ?
[$VAR->domain->physicalHosting->loopbackIpAddress] :
$VAR->domain->physicalHosting->ipAddresses;
if ($VAR->domain->physicalHosting->ssl) {
foreach ($ipAddresses as $ipAddress) {
if ($ipAddress->defaultDomainId === $VAR->domain->id) {
echo $VAR->includeTemplate('domain/domainVirtualHost.php', [
'ssl' => true,
'ipAddress' => $ipAddress,
]);
}
}
}
foreach ($ipAddresses as $ipAddress) {
if ($ipAddress->defaultDomainId === $VAR->domain->id) {
echo $VAR->includeTemplate('domain/domainVirtualHost.php', [
'ssl' => false,
'ipAddress' => $ipAddress,
]);
}
}

View File

@@ -1,56 +0,0 @@
<?php echo AUTOGENERATED_CONFIGS; ?>
<?php /** @var Template_VariableAccessor $VAR */ ?>
map $host $ip_default_host {
<?php foreach ($VAR->server->ipAddresses->all as $ipAddress): ?>
<?php echo $ipAddress->escapedAddress . ' ' . $ipAddress->defaultServerName ?>;
<?php endforeach ?>
default $host;
}
include "<?= $VAR->server->nginx->httpConfDir ?>/plesk.conf.d/ip_default/*.conf";
<?php if (!$VAR->panel->isDefaultAccessDomain) { ?>
<?= $VAR->includeTemplate('server/nginxVhosts.php', [
'ssl' => true,
'http2' => $VAR->server->nginx->http2,
'http3' => $VAR->server->nginx->http3,
'frontendPort' => $VAR->server->nginx->httpsPort,
'backendPort' => $VAR->server->webserver->httpsPort,
'reuseport' => true,
]) ?>
<?php } ?>
<?= $VAR->includeTemplate('server/nginxPleskAccess.php', ['reuseport' => $VAR->panel->isDefaultAccessDomain]) ?>
<?= $VAR->includeTemplate('server/nginxVhosts.php', [
'ssl' => false,
'http2' => $VAR->server->nginx->http2,
'http3' => $VAR->server->nginx->http3,
'frontendPort' => $VAR->server->nginx->httpPort,
'backendPort' => $VAR->server->webserver->httpPort,
'reuseport' => false,
]) ?>
<?php
/* Special subdomains section */
if ($VAR->server->mailman->isAvailable) {
echo $VAR->includeTemplate('server/nginxVhosts.php', [
'ssl' => true,
'http2' => $VAR->server->nginx->http2,
'http3' => $VAR->server->nginx->http3,
'frontendPort' => $VAR->server->nginx->httpsPort,
'backendPort' => $VAR->server->webserver->httpsPort,
'reuseport' => false,
'serverNames' => ['lists.*'],
]);
} ?>
<?php /* Next block used for watchdog */ ?>
<?php if (!$VAR->server->ipAddresses->hasIpV4Address) { ?>
server {
listen 127.0.0.1 default_server;
return 200;
}
<?php } ?>

View File

@@ -1,42 +0,0 @@
<?php
echo AUTOGENERATED_CONFIGS;
/** @var Template_VariableAccessor $VAR */
if (!$VAR->domain->active) {
echo "# Domain is disabled or suspended\n";
return;
}
if ($VAR->domain->forwarding->ssl) {
foreach ($VAR->domain->forwarding->ipAddresses as $ipAddress) {
if ($ipAddress->defaultDomainId != $VAR->domain->id) {
if ($VAR->domain->hasStandardForwarding || $VAR->domain->hasFrameForwarding) {
echo $VAR->includeTemplate('domain/nginxForwarding.php', [
'ssl' => true,
'http2' => $VAR->server->nginx->http2,
'http3' => $VAR->server->nginx->http3,
'ipAddress' => $ipAddress,
'frontendPort' => $VAR->server->nginx->httpsPort,
'backendPort' => $VAR->server->webserver->httpsPort,
'default' => false,
]);
}
}
}
}
foreach ($VAR->domain->forwarding->ipAddresses as $ipAddress) {
if ($ipAddress->defaultDomainId != $VAR->domain->id) {
if ($VAR->domain->hasStandardForwarding || $VAR->domain->hasFrameForwarding) {
echo $VAR->includeTemplate('domain/nginxForwarding.php', [
'ssl' => false,
'http2' => $VAR->server->nginx->http2,
'http3' => $VAR->server->nginx->http3,
'ipAddress' => $ipAddress,
'frontendPort' => $VAR->server->nginx->httpPort,
'backendPort' => $VAR->server->webserver->httpPort,
'default' => false,
]);
}
}
}

View File

@@ -1,38 +0,0 @@
<?php
echo AUTOGENERATED_CONFIGS;
/** @var Template_VariableAccessor $VAR */
if (!$VAR->domain->active) {
echo "# Domain is disabled or suspended\n";
return;
}
if ($VAR->domain->forwarding->ssl) {
foreach ($VAR->domain->forwarding->ipAddresses as $ipAddress) {
if ($ipAddress->defaultDomainId == $VAR->domain->id) {
echo $VAR->includeTemplate('domain/nginxForwarding.php', [
'ssl' => true,
'http2' => $VAR->server->nginx->http2,
'http3' => $VAR->server->nginx->http3,
'ipAddress' => $ipAddress,
'frontendPort' => $VAR->server->nginx->httpsPort,
'backendPort' => $VAR->server->webserver->httpsPort,
'default' => true,
]);
}
}
}
foreach ($VAR->domain->forwarding->ipAddresses as $ipAddress) {
if ($ipAddress->defaultDomainId == $VAR->domain->id) {
echo $VAR->includeTemplate('domain/nginxForwarding.php', [
'ssl' => false,
'http2' => $VAR->server->nginx->http2,
'http3' => $VAR->server->nginx->http3,
'ipAddress' => $ipAddress,
'frontendPort' => $VAR->server->nginx->httpPort,
'backendPort' => $VAR->server->webserver->httpPort,
'default' => true,
]);
}
}

View File

@@ -1,11 +0,0 @@
<?php
echo AUTOGENERATED_CONFIGS;
/** @var Template_VariableAccessor $VAR */
if ($VAR->domain->disabled) {
echo "# Domain is disabled\n";
return;
}
echo "\n";
echo $VAR->domain->physicalHosting->nginxWebAppFirewallSettings;

View File

@@ -1,42 +0,0 @@
<?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,
]);
}
}

View File

@@ -1,39 +0,0 @@
<?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,
]);
}
}

View File

@@ -1,85 +0,0 @@
<?php
/**
* @var Template_VariableAccessor $VAR
*/
echo AUTOGENERATED_CONFIGS;
?>
<?php if ($VAR->server->fullHostName): ?>
ServerName "<?php echo $VAR->server->fullHostName ?>"
<?php endif; ?>
DocumentRoot "<?php echo $VAR->server->webserver->httpDir ?>"
<IfModule mod_logio.c>
LogFormat "<?php echo $VAR->server->webserver->apache->pipelogEnabled ? '%v@@%p@@' : ''?>%a %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" plesklog
</IfModule>
<IfModule !mod_logio.c>
LogFormat "<?php echo $VAR->server->webserver->apache->pipelogEnabled ? '%v@@%p@@' : ''?>%a %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" plesklog
</IfModule>
<?php if ($VAR->server->webserver->apache->pipelogEnabled): ?>
CustomLog "|<?php echo $VAR->server->productRootDir ?>/admin/sbin/pipelog <?php echo $VAR->server->webserver->httpsPort ?>" plesklog
<?php endif; ?>
<?php echo $VAR->includeTemplate('server/PCI_compliance.php') ?>
<Directory "<?php echo $VAR->server->webserver->vhostsDir ?>">
AllowOverride "<?php echo $VAR->server->webserver->apache->allowOverrideDefault ?>"
Options SymLinksIfOwnerMatch
Require all granted
Order allow,deny
Allow from all
<?php echo $VAR->includeTemplate('service/php.php', array(
'enabled' => false,
)) ?>
</Directory>
<Directory "<?php echo $VAR->server->mailman->rootDir ?>">
AllowOverride All
Options SymLinksIfOwnerMatch
Require all granted
<IfModule <?php echo $VAR->server->webserver->apache->php4ModuleName ?>>
php_admin_flag engine off
</IfModule>
<IfModule mod_php5.c>
php_admin_flag engine off
</IfModule>
</Directory>
<?php if (!$VAR->server->webserver->proxyActive && $VAR->server->xPoweredByHeader) : ?>
<IfModule mod_headers.c>
Header add X-Powered-By PleskLin
</IfModule>
<?php endif ?>
<IfModule mod_security2.c>
<?php echo $VAR->server->webserver->apacheWebAppFirewallSettings ?>
</IfModule>
<?php echo $VAR->server->webserver->includeOptionalConfig($VAR->server->webserver->ipDefaultConfigs) ?>
<?=$VAR->includeTemplate('server/vhosts.php', [
'ssl' => false,
'ipLimit' => $VAR->server->webserver->apache->vhostIpCapacity,
])?>
<?php if (!$VAR->panel->isDefaultAccessDomain || $VAR->server->webserver->proxyActive): ?>
<?=$VAR->includeTemplate('server/vhosts.php', [
'ssl' => true,
'ipLimit' => 1,
])?>
<?php endif ?>
<?=$VAR->includeTemplate('server/apachePleskAccess.php', [
'ipLimit' => $VAR->server->webserver->apache->vhostIpCapacity,
])?>
<?=$VAR->includeTemplate('server/pleskServiceLocaldomain.php')?>
<?php if ($VAR->server->mailman->isAvailable): ?>
<?=$VAR->includeTemplate('server/mailman.php') ?>
<?php endif; ?>
<?php echo $VAR->includeTemplate('server/remoteip.php', array('mod' => 'mod_remoteip.c')); ?>

View File

@@ -1,5 +0,0 @@
<?php if (!$VAR->server->webserver->apache->traceEnableCompliance): ?>
TraceEnable off
<?php endif; ?>
ServerTokens ProductOnly

View File

@@ -1,65 +0,0 @@
<?php /** @var Template_VariableAccessor $VAR */ ?>
<?php /** @var array $OPT */ ?>
<?php if (!$VAR->panel->isHttpsProxyEnabled || $VAR->server->webserver->proxyActive): ?>
<?php return ?>
<?php endif ?>
<IfModule mod_ssl.c>
<?php for ($ipAddresses = $VAR->server->ipAddresses->all, $ipAddress = reset($ipAddresses); $ipAddress; $ipAddress = next($ipAddresses)): ?>
<VirtualHost <?php
echo "{$ipAddress->escapedAddress}:{$VAR->server->webserver->httpsPort}";
for ($n = 1; $n < $OPT['ipLimit'] && $ipAddress = next($ipAddresses); $n++) {
echo " {$ipAddress->escapedAddress}:{$VAR->server->webserver->httpsPort}";
}
if ($VAR->server->webserver->proxyActive) {
echo " 127.0.0.1:{$VAR->server->webserver->httpsPort}";
}
?>>
<?php $sslCertificate = $VAR->panel->sslCertificate ?>
<?php if ($sslCertificate->ceFilePath): ?>
SSLEngine on
SSLVerifyClient none
SSLCertificateFile "<?=$sslCertificate->ceFilePath?>"
<?php if ($sslCertificate->caFilePath): ?>
SSLCACertificateFile "<?=$sslCertificate->caFilePath?>"
<?php endif ?>
<?php endif ?>
<?php if ($VAR->panel->accessDomainName): ?>
ServerName <?=$VAR->quote($VAR->panel->accessDomainName)?>
<?php else: ?>
ServerName "default"
<?php endif ?>
UseCanonicalName Off
LimitRequestBody 2147483647
ProxyTimeout 600
<IfModule mod_proxy_http.c>
<Location />
ProxyPass http://127.0.0.1:8880/
ProxyPassReverse http://127.0.0.1:8880/
ProxyPreserveHost On
RequestHeader set "X-Forwarded-Proto" "https"
Order allow,deny
Allow from all
</Location>
<LocationMatch "^/(.+/)?(ws|websocket)(/.*)?$">
ProxyPassMatch ws://127.0.0.1:8880/$1$2$3
ProxyPreserveHost On
RequestHeader set "X-Forwarded-Proto" "https"
Order allow,deny
Allow from all
</LocationMatch>
</IfModule>
<?php if ($VAR->panel->isApacheModSecurityEnabled) { ?>
<IfModule mod_security2.c>
SecRuleEngine Off
</IfModule>
<?php } ?>
</VirtualHost>
<?php endfor ?>
</IfModule>

View File

@@ -1,120 +0,0 @@
<?php /** @var Template_VariableAccessor $VAR */ ?>
<?php
$ipAddresses = $VAR->server->webserver->listenLocalhost ?
[$VAR->server->ipAddresses->loopbackIpAddress] :
$VAR->server->ipAddresses->all;
$ipLimit = $VAR->server->webserver->apache->vhostIpCapacity;
?>
<?php if ($VAR->server->mailman->isMailman3): ?>
Listen 127.0.0.1:7082 http
<?php endif; ?>
<?php for($ipAddress = reset($ipAddresses); $ipAddress; $ipAddress = next($ipAddresses)): ?>
<VirtualHost <?php
echo "{$ipAddress->escapedAddress}:{$VAR->server->webserver->httpPort}";
for ($n = 1; $n < $ipLimit && $ipAddress = next($ipAddresses); ++$n) {
echo " {$ipAddress->escapedAddress}:{$VAR->server->webserver->httpPort}";
}
echo ($VAR->server->webserver->proxyActive && !$VAR->server->webserver->listenLocalhost) ? " 127.0.0.1:{$VAR->server->webserver->httpPort}" : '';
echo ($VAR->server->mailman->isMailman3) ? " 127.0.0.1:7082" : '';
?>>
DocumentRoot "<?php echo $VAR->server->webserver->httpDir ?>"
ServerName lists
ServerAlias lists.*
UseCanonicalName Off
<?php echo $VAR->includeTemplate('domain/PCI_compliance.php') ?>
<?php if ($VAR->server->mailman->redirectToSsl && $VAR->server->defaultSslCertificate): ?>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L,QSA]
</IfModule>
<?php else: ?>
<?php foreach ($VAR->server->mailman->scriptAliases as $urlPath => $filePath): ?>
ScriptAlias "<?php echo $urlPath ?>" "<?php echo $filePath ?>"
<?php endforeach; ?>
<?php foreach ($VAR->server->mailman->aliases as $urlPath => $filePath): ?>
Alias "<?php echo $urlPath ?>" "<?php echo $filePath ?>"
<?php endforeach; ?>
<IfModule mod_ssl.c>
SSLEngine off
</IfModule>
<?php if ($VAR->server->mailman->isMailman3): ?>
<Directory <?php echo $VAR->server->mailman->varDir ?>/web/static/>
<?php else: ?>
<Directory <?php echo $VAR->server->mailman->varDir ?>/archives/>
<?php endif; ?>
Options FollowSymLinks
Require all granted
</Directory>
<?php if ($VAR->server->mailman->isMailman3): ?>
<IfModule mod_proxy_uwsgi.c>
ProxyPass /mailman3/favicon.ico !
ProxyPass /mailman3/static !
ProxyPass /mailman3 unix:/run/mailman3-web/uwsgi.sock|uwsgi://localhost/
</IfModule>
<?php endif; ?>
<?php endif; ?>
</VirtualHost>
<?php endfor; ?>
<?php if ($VAR->server->defaultSslCertificate): ?>
<IfModule mod_ssl.c>
<?php for ($ipAddress = reset($ipAddresses); $ipAddress; $ipAddress = next($ipAddresses)): ?>
<?php /** @var Template_Variable_IpAddress $ipAddress */ ?>
<VirtualHost <?php
echo "{$ipAddress->escapedAddress}:{$VAR->server->webserver->httpsPort}";
for ($n = 1; $n < $ipLimit && $ipAddress = next($ipAddresses); ++$n) {
echo " {$ipAddress->escapedAddress}:{$VAR->server->webserver->httpsPort}";
}
echo ($VAR->server->webserver->proxyActive && !$VAR->server->webserver->listenLocalhost) ? " 127.0.0.1:{$VAR->server->webserver->httpsPort}" : '';
?>>
DocumentRoot "<?php echo $VAR->server->webserver->httpsDir ?>"
ServerName lists
ServerAlias lists.*
UseCanonicalName Off
<?php foreach ($VAR->server->mailman->scriptAliases as $urlPath => $filePath): ?>
ScriptAlias "<?php echo $urlPath ?>" "<?php echo $filePath ?>"
<?php endforeach; ?>
<?php foreach ($VAR->server->mailman->aliases as $urlPath => $filePath): ?>
Alias "<?php echo $urlPath ?>" "<?php echo $filePath ?>"
<?php endforeach; ?>
SSLEngine on
SSLVerifyClient none
SSLCertificateFile "<?= $VAR->server->defaultSslCertificate->ceFilePath ?>"
<?php echo $VAR->includeTemplate('domain/PCI_compliance.php') ?>
<?php if ($VAR->server->mailman->isMailman3): ?>
<Directory <?php echo $VAR->server->mailman->varDir ?>/web/static/>
<?php else: ?>
<Directory <?php echo $VAR->server->mailman->varDir ?>/archives/>
<?php endif; ?>
Options FollowSymLinks
Require all granted
</Directory>
<?php if ($VAR->server->mailman->isMailman3): ?>
<IfModule mod_proxy_uwsgi.c>
ProxyPass /mailman3/favicon.ico !
ProxyPass /mailman3/static !
ProxyPass /mailman3 unix:/run/mailman3-web/uwsgi.sock|uwsgi://localhost/
</IfModule>
<?php endif; ?>
</VirtualHost>
<?php endfor; ?>
</IfModule>
<?php endif ?>

View File

@@ -1,78 +0,0 @@
<?php /** @var Template_VariableAccessor $VAR */ ?>
<?php /** @var array $OPT */ ?>
<?php if (!$VAR->panel->isHttpsProxyEnabled): ?>
<?php return ?>
<?php endif ?>
server {
<?php foreach ($VAR->server->ipAddresses->all as $ipAddress): ?>
<?php if ($VAR->server->nginx->http3) : ?>
listen <?php echo $ipAddress->escapedAddress . ':' . $VAR->server->nginx->httpsPort ?> quic <?php echo ($OPT['reuseport'] ?? false) ? 'reuseport' : '' ?>;
<?php endif ?>
listen <?php echo $ipAddress->escapedAddress . ':' . $VAR->server->nginx->httpsPort . ' ssl' ?>;
<?php endforeach ?>
<?php if ($VAR->server->nginx->http3) : ?>
add_header Alt-Svc <?php echo '\'h3=":' . $VAR->server->nginx->httpsPort . '"; ma=86400\'' ?>;
<?php endif ?>
<?php if ($VAR->server->nginx->http2) : ?>
http2 on;
<?php endif ?>
<?php $sslCertificate = $VAR->panel->sslCertificate ?>
<?php if ($sslCertificate->ceFilePath): ?>
ssl_certificate "<?=$sslCertificate->ceFilePath?>";
ssl_certificate_key "<?=$sslCertificate->ceFilePath?>";
<?php endif ?>
client_max_body_size 2048m;
proxy_read_timeout 600;
proxy_send_timeout 600;
proxy_max_temp_file_size 0;
proxy_buffers 16 16k;
proxy_buffer_size 32k;
proxy_busy_buffers_size 32k;
<?php if (!$VAR->panel->isDefaultAccessDomain) { ?>
server_name <?= $VAR->quote($VAR->panel->accessDomainName) ?>;
<?php } else { ?>
server_name _;
<?php } ?>
<?php if ($VAR->panel->isNginxModSecurityEnabled) { ?>
modsecurity_rules '
SecRuleEngine Off
';
<?php } ?>
location / {
proxy_pass http://127.0.0.1:8880;
proxy_redirect http://$host:8880 $scheme://$host;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Http-Host $host:$server_port;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
access_log off;
gzip on;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript;
}
location ~ /(ws|websocket)(/|$) {
proxy_pass http://127.0.0.1:8880;
proxy_redirect off;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Http-Host $host:$server_port;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
access_log off;
}
underscores_in_headers on;
}

View File

@@ -1,61 +0,0 @@
<?php /** @var Template_VariableAccessor $VAR */ ?>
<?php /** @var array $OPT */ ?>
<?php foreach ($VAR->server->ipAddresses->all as $ipAddress): ?>
<?php /** @var Template_Variable_IpAddress $ipAddress */ ?>
<?php
if ($OPT['ssl'] && !$ipAddress->sslCertificate) {
continue;
}
?>
server {
<?php if ($OPT['ssl'] && $OPT['http3']) : ?>
listen <?php echo $ipAddress->escapedAddress . ':' . $OPT['frontendPort'] ?> quic <?php echo ($OPT['reuseport'] ?? false) ? 'reuseport' : '' ?>;
add_header Alt-Svc <?php echo '\'h3=":' . $OPT['frontendPort'] . '"; ma=86400\'' ?>;
<?php endif; ?>
listen <?php echo "{$ipAddress->escapedAddress}:{$OPT['frontendPort']}" . ($OPT['ssl'] ? ' ssl' : '') ?>;
<?php if ($OPT['ssl'] && $OPT['http2']) : ?>
http2 on;
<?php endif; ?>
<?php if (!empty($OPT['serverNames'])): ?>
server_name <?php echo implode(', ', $OPT['serverNames']); ?>;
<?php endif; ?>
<?php if ($OPT['ssl']): ?>
<?php $sslCertificate = $ipAddress->sslCertificate; ?>
<?php if ($sslCertificate->ceFilePath): ?>
ssl_certificate <?php echo $sslCertificate->ceFilePath ?>;
ssl_certificate_key <?php echo $sslCertificate->ceFilePath ?>;
<?php endif ?>
<?php endif ?>
<?php if (empty($OPT['serverNames'])) { ?>
<?= $VAR->includeTemplate('service/nginxSitePreview.php') ?>
<?php } ?>
location / {
<?php if ($OPT['ssl']): ?>
proxy_pass https://<?php echo $ipAddress->proxyEscapedAddress . ':' . $OPT['backendPort']; ?>;
proxy_hide_header upgrade;
proxy_ssl_server_name on;
<?php if ($VAR->server->webserver->listenLocalhost): ?>
proxy_ssl_name $ip_default_host;
<?php else: ?>
proxy_ssl_name $host;
<?php endif ?>
proxy_ssl_session_reuse off;
<?php else: ?>
proxy_pass http://<?php echo $ipAddress->proxyEscapedAddress . ':' . $OPT['backendPort']; ?>;
<?php endif ?>
<?php if ($VAR->server->webserver->listenLocalhost): ?>
proxy_set_header Host $ip_default_host;
<?php else: ?>
proxy_set_header Host $host;
<?php endif ?>
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
<?php endforeach; ?>

View File

@@ -1,23 +0,0 @@
<Directory "<?php echo HTTPD_SERVICE_VHOST_D ?>">
AllowOverride None
Options None
Require ip 127.0.0.1
Order deny,allow
Deny from all
Allow from 127.0.0.1
</Directory>
<VirtualHost 127.0.0.1:<?php echo $VAR->server->webserver->httpPort ?>>
ServerName "<?php echo HTTPD_SERVICE_VHOST_NAME; ?>"
UseCanonicalName Off
DocumentRoot "<?php echo HTTPD_SERVICE_VHOST_D; ?>"
</VirtualHost>
<VirtualHost 127.0.0.1:<?php
/* SSL configuration is intentionally skipped. */
echo $VAR->server->webserver->httpsPort
?>>
ServerName "<?php echo HTTPD_SERVICE_VHOST_NAME; ?>"
UseCanonicalName Off
DocumentRoot "<?php echo HTTPD_SERVICE_VHOST_D; ?>"
</VirtualHost>

View File

@@ -1,13 +0,0 @@
<IfModule <?php echo $OPT['mod'] ?>>
<?php
$ipAddresses = $VAR->server->webserver->listenLocalhost ?
[$VAR->server->ipAddresses->loopbackIpAddress] :
$VAR->server->ipAddresses->all;
$vhostIpCapacity = $VAR->server->webserver->apache->vhostIpCapacity;
?>
<?php for ($ipAddress = reset($ipAddresses); $ipAddress; $ipAddress = next($ipAddresses)): ?>
RemoteIPInternalProxy <?php echo $ipAddress->address ?><?php for ($n = 1; $n < $vhostIpCapacity && $ipAddress = next($ipAddresses); $n++) { echo " {$ipAddress->address}"; } ?>
<?php echo "\n"; ?>
<?php endfor; ?>
RemoteIPHeader X-Forwarded-For
</IfModule>

View File

@@ -1,70 +0,0 @@
<?php /** @var Template_VariableAccessor $VAR */ ?>
<?php /** @var array $OPT */ ?>
<?php if ($OPT['ssl']) : ?>
<IfModule mod_ssl.c>
<?php endif; ?>
<?php for ($ipAddresses = $VAR->server->ipAddresses->all, $ipAddress = reset($ipAddresses); $ipAddress; $ipAddress = next($ipAddresses)): ?>
<?php /** @var Template_Variable_IpAddress $ipAddress */ ?>
<?php
if ($OPT['ssl'] && !$ipAddress->sslCertificate) {
continue;
}
?>
<VirtualHost <?php
$webServerPort = $OPT['ssl'] ? $VAR->server->webserver->httpsPort : $VAR->server->webserver->httpPort;
echo $VAR->server->webserver->listenLocalhost ? '' : "{$ipAddress->escapedAddress}:{$webServerPort}";
for ($n = 1; $n < $OPT['ipLimit'] && $ipAddress = next($ipAddresses); $n++) {
echo $VAR->server->webserver->listenLocalhost ? '' : " {$ipAddress->escapedAddress}:{$webServerPort}";
}
if ($VAR->server->webserver->proxyActive) {
echo " 127.0.0.1:{$webServerPort}";
}
?>>
ServerName "<?php echo 1 == $OPT['ipLimit'] ? $ipAddress->defaultServerName . ($VAR->server->webserver->listenLocalhost && $ipAddress->defaultDomainId ? '-localhost' : '') : 'default' ?>"
UseCanonicalName Off
DocumentRoot "<?php echo $OPT['ssl'] ? $VAR->server->webserver->httpsDir : $VAR->server->webserver->httpDir ?>"
ScriptAlias /cgi-bin/ "<?php echo $VAR->server->webserver->cgiBinDir ?>"
<?php echo $VAR->includeTemplate('domain/PCI_compliance.php') ?>
<?php if ($OPT['ssl']) : ?>
<?php if ($ipAddress->sslCertificate->ceFilePath): ?>
SSLEngine on
SSLVerifyClient none
SSLCertificateFile "<?php echo $ipAddress->sslCertificate->ceFilePath ?>"
<?php if ($ipAddress->sslCertificate->caFilePath): ?>
SSLCACertificateFile "<?php echo $ipAddress->sslCertificate->caFilePath ?>"
<?php endif; ?>
<?php endif; ?>
<?php else: ?>
<IfModule mod_ssl.c>
SSLEngine off
</IfModule>
<?php endif; ?>
<Directory "<?php echo $VAR->server->webserver->cgiBinDir ?>">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
<Directory <?php echo $OPT['ssl'] ? $VAR->server->webserver->httpsDir : $VAR->server->webserver->httpDir ?>>
<?php echo $VAR->includeTemplate('service/php.php', array(
'enabled' => true,
'safe_mode' => true,
'dir' => $OPT['ssl'] ? $VAR->server->webserver->httpsDir : $VAR->server->webserver->httpDir,
)) ?>
</Directory>
</VirtualHost>
<?php endfor; ?>
<?php if ($OPT['ssl']) : ?>
</IfModule>
<?php endif; ?>

View File

@@ -1,6 +0,0 @@
<IfModule mod_fcgid.c>
<Files ~ (\.fcgi$)>
SetHandler fcgid-script
Options +ExecCGI
</Files>
</IfModule>

View File

@@ -1,9 +0,0 @@
<IfModule mod_perl.c>
<Files ~ (\.pl$)>
SetHandler perl-script
PerlHandler ModPerl::Registry
Options +ExecCGI
allow from all
PerlSendHeader On
</Files>
</IfModule>

View File

@@ -1,6 +0,0 @@
<IfModule mod_python.c>
<Files ~ (\.py$)>
SetHandler python-program
PythonHandler mod_python.cgihandler
</Files>
</IfModule>

View File

@@ -1,10 +0,0 @@
<?php /** @var Template_VariableAccessor $VAR */ ?>
location ^~ /plesk-site-preview/ {
proxy_pass <?php echo $VAR->server->sitePreviewAddress ?>;
proxy_set_header Host plesk-site-preview.local;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_cookie_domain plesk-site-preview.local $host;
access_log off;
}

View File

@@ -1,44 +0,0 @@
<IfModule <?php echo $VAR->server->webserver->apache->php4ModuleName ?>>
<?php
if ($OPT['enabled']) {
echo "php_admin_flag engine on\n";
if (isset($OPT['settings'])) {
echo $OPT['settings'];
}
} else {
echo "php_admin_flag engine off\n";
}
?>
</IfModule>
<IfModule mod_php5.c>
<?php
if (array_key_exists('enabled', $OPT) && $OPT['enabled']) {
echo "php_admin_flag engine on\n";
if (isset($OPT['settings'])) {
echo $OPT['settings'];
}
} else {
echo "php_admin_flag engine off\n";
}
?>
</IfModule>
<IfModule mod_php7.c>
<?php
if (array_key_exists('enabled', $OPT) && $OPT['enabled']) {
echo "php_admin_flag engine on\n";
if (isset($OPT['settings'])) {
echo $OPT['settings'];
}
} else {
echo "php_admin_flag engine off\n";
}
?>
</IfModule>

View File

@@ -1,5 +0,0 @@
<Files ~ (\.php$)>
SetHandler None
AddHandler php-script .php
Options +ExecCGI
</Files>

View File

@@ -1,7 +0,0 @@
<IfModule mod_fcgid.c>
<Files ~ (\.php$)>
SetHandler fcgid-script
FCGIWrapper <?php echo $VAR->server->webserver->apache->phpCgiBin ?> .php
Options +ExecCGI
</Files>
</IfModule>

View File

@@ -1,15 +0,0 @@
<IfModule mod_proxy_fcgi.c>
<?php if ($VAR->server->webserver->listenLocalhost && $VAR->server->webserver->apache->proxyFCGISetEnvIfSupported): ?>
<?php
foreach ($VAR->domain->physicalHosting->ipAddresses as $ipAddress) {
if (!$ipAddress->isIpV6()) {
break;
}
}
?>
ProxyFCGISetEnvIf "true" SERVER_ADDR "<?= $ipAddress->address ?>"
<?php endif; ?>
<Files ~ (\.php$)>
SetHandler proxy:<?php echo $VAR->domain->physicalHosting->fpmSocket ?>|fcgi://127.0.0.1:9000
</Files>
</IfModule>

View File

@@ -1,54 +0,0 @@
<?php
/** @var Template_VariableAccessor $VAR */
$atmailDocroot = $VAR->server->webserver->atmail->docroot;
$atmailConfD = "/etc/psa-webmail/atmail";
$modPHPAvailiable = $VAR->server->php->ModAvailable;
?>
DocumentRoot "<?php echo $atmailDocroot ?>"
Alias /atmail/ "<?php echo $atmailDocroot ?>/"
CustomLog /var/log/atmail/access_log plesklog
ErrorLog /var/log/atmail/error_log
<Directory "<?php echo $atmailDocroot ?>">
<?php if ($modPHPAvailiable): ?>
<IfModule <?php echo $VAR->server->webserver->apache->php4ModuleName ?>>
php_admin_flag engine on
php_admin_flag safe_mode off
php_admin_flag magic_quotes_gpc off
php_admin_flag register_globals off
php_admin_value open_basedir "<?php echo
"$atmailDocroot/:/var/log/atmail/:$atmailConfD/:/tmp/:/var/tmp/" ?>"
php_admin_value include_path "<?php echo
"$atmailDocroot:$atmailDocroot/libs:$atmailDocroot/libs/Atmail:$atmailDocroot/libs/PEAR:$atmailDocroot/libs/File:." ?>"
php_admin_value upload_max_filesize 16M
php_admin_value post_max_size 16M
</IfModule>
<IfModule mod_php5.c>
php_admin_flag engine on
php_admin_flag safe_mode off
php_admin_flag magic_quotes_gpc off
php_admin_flag register_globals off
php_admin_value open_basedir "<?php echo
"$atmailDocroot/:/var/log/atmail/:$atmailConfD/:/tmp/:/var/tmp/" ?>"
php_admin_value include_path "<?php echo
"$atmailDocroot:$atmailDocroot/libs:$atmailDocroot/libs/Atmail:$atmailDocroot/libs/PEAR:$atmailDocroot/libs/File:." ?>"
php_admin_value upload_max_filesize 16M
php_admin_value post_max_size 16M
</IfModule>
<?php else: ?>
SetHandler None
AddHandler php-script .php
Options +ExecCGI
<?php endif; ?>
Require all granted
</Directory>

View File

@@ -1,29 +0,0 @@
<?php
/** @var Template_VariableAccessor $VAR */
$hordeDocroot = $VAR->server->webserver->horde->docroot;
$hordeSysUser = "horde_sysuser";
$hordeSysGroup = "horde_sysgroup";
$hordePhpIni = $VAR->server->webserver->horde->confD . "/horde/php.ini";
?>
DocumentRoot "<?php echo $hordeDocroot ?>"
Alias /horde/ "<?php echo $hordeDocroot ?>/"
<IfModule mod_suexec.c>
SuexecUserGroup "<?php echo $hordeSysUser; ?>" "<?php echo $hordeSysGroup; ?>"
</IfModule>
<IfModule mod_fcgid.c>
FcgidInitialEnv PP_CUSTOM_PHP_CGI_INDEX plesk-php74-fastcgi
FcgidInitialEnv PP_CUSTOM_PHP_INI "<?php echo $hordePhpIni; ?>"
FcgidMaxRequestLen 134217728
FcgidPassHeader Authorization
<Directory "<?php echo $hordeDocroot ?>">
<Files ~ (\.php$)>
SetHandler fcgid-script
FCGIWrapper <?php echo $VAR->server->webserver->apache->phpCgiBin ?> .php
Options +ExecCGI
</Files>
Require all granted
</Directory>
</IfModule>

View File

@@ -1,25 +0,0 @@
<?php echo AUTOGENERATED_CONFIGS; ?>
<?php
/**
* @var Template_VariableAccessor $VAR
*/
?>
<?php echo $VAR->includeTemplate('webmail/nginxWebmailPartial.php',
array(
'ssl' => true,
'http2' => $VAR->server->nginx->http2,
'http3' => $VAR->server->nginx->http3,
'frontendPort' => $VAR->server->nginx->httpsPort,
'backendPort' => $VAR->server->webserver->httpsPort,
)) ?>
<?php echo $VAR->includeTemplate('webmail/nginxWebmailPartial.php',
array(
'ssl' => false,
'http2' => $VAR->server->nginx->http2,
'http3' => $VAR->server->nginx->http3,
'frontendPort' => $VAR->server->nginx->httpPort,
'backendPort' => $VAR->server->webserver->httpPort,
)) ?>

View File

@@ -1,60 +0,0 @@
<?php /** @var Template_VariableAccessor $VAR */ ?>
<?php /** @var array $OPT */ ?>
<?php
if (!$VAR->domain->webmail->isActive && !$VAR->domain->webmail->suspended) {
echo "# Webmail is not enabled on the domain\n";
return;
}
if ($OPT['ssl'] && !$VAR->domain->webmail->sslCertificate) {
return;
}
?>
<?php foreach ($VAR->domain->webmail->ipAddresses as $ipAddress): ?>
server {
<?php if ($OPT['ssl'] && $OPT['http3']) : ?>
listen <?php echo $ipAddress->escapedAddress . ':' . $OPT['frontendPort'] ?> quic;
add_header Alt-Svc <?php echo '\'h3=":' . $OPT['frontendPort'] . '"; ma=86400\'' ?>;
<?php endif; ?>
listen <?php echo $ipAddress->escapedAddress . ':' . $OPT['frontendPort'] . ($OPT['ssl'] ? ' ssl' : '') ?>;
<?php if ($OPT['ssl'] && $OPT['http2']) : ?>
http2 on;
<?php endif; ?>
server_name "webmail.<?php echo $VAR->domain->asciiName ?>";
<?php foreach ($VAR->domain->mailAliases as $alias): ?>
server_name "webmail.<?php echo $alias->asciiName ?>";
<?php endforeach; ?>
<?php if ($OPT['ssl']): ?>
<?php $sslCertificate = $VAR->domain->webmail->sslCertificate; ?>
<?php if ($sslCertificate->ceFilePath): ?>
ssl_certificate <?php echo $sslCertificate->ceFilePath ?>;
ssl_certificate_key <?php echo $sslCertificate->ceFilePath ?>;
<?php endif ?>
<?php endif ?>
client_max_body_size 128m;
<?php if (!in_array($VAR->domain->webmail->type, ['atmail', 'horde', 'roundcube'])) {
echo "# Using custom webmail type: '{$VAR->domain->webmail->type}'";
} ?>
<?=$VAR->domain->webmail->nginxExtensionsConfigs?>
location / {
<?php if ($OPT['ssl']): ?>
proxy_pass https://<?php echo $ipAddress->proxyEscapedAddress . ':' . $OPT['backendPort'] ?>;
proxy_hide_header upgrade;
proxy_ssl_server_name on;
proxy_ssl_name $host;
proxy_ssl_session_reuse off;
<?php else: ?>
proxy_pass http://<?php echo $ipAddress->proxyEscapedAddress . ':' . $OPT['backendPort'] ?>;
<?php endif ?>
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
<?php endforeach; ?>

View File

@@ -1,35 +0,0 @@
<?php
/** @var Template_VariableAccessor $VAR */
$roundcubeDocroot = $VAR->server->webserver->roundcube->docroot;
$roundcubeConfD = "/etc/psa-webmail/roundcube";
$roundcubeSysUser = "roundcube_sysuser";
$roundcubeSysGroup = "roundcube_sysgroup";
$roundcubeHtaccess = $VAR->server->webserver->httpConfDir . "/plesk.conf.d/roundcube.htaccess.inc";
$roundcubePhpIni = $roundcubeConfD . "/php.ini";
$roundcubePhpHandler = $VAR->server->webserver->roundcube->phpHandler;
?>
DocumentRoot "<?php echo $roundcubeDocroot ?>"
Alias /roundcube/ "<?php echo $roundcubeDocroot ?>/"
<IfModule mod_suexec.c>
SuexecUserGroup <?php echo $roundcubeSysUser; ?> <?php echo $roundcubeSysGroup; ?>
</IfModule>
<IfModule mod_fcgid.c>
FcgidInitialEnv PP_CUSTOM_PHP_CGI_INDEX "<?php echo $roundcubePhpHandler; ?>"
FcgidInitialEnv PP_CUSTOM_PHP_INI "<?php echo $roundcubePhpIni; ?>"
FcgidMaxRequestLen 134217728
<Directory "<?php echo $roundcubeDocroot ?>">
Options -Indexes +FollowSymLinks
AllowOverride FileInfo AuthConfig Limit
Require all granted
Include "<?php echo $roundcubeHtaccess ?>"
<Files ~ (\.php$)>
SetHandler fcgid-script
FCGIWrapper <?php echo $VAR->server->webserver->apache->phpCgiBin ?> .php
Options +ExecCGI
</Files>
</Directory>
</IfModule>

View File

@@ -1,7 +0,0 @@
<?php echo AUTOGENERATED_CONFIGS; ?>
<?php /** @var Template_VariableAccessor $VAR */ ?>
<?php
if ($VAR->domain->hasPhysicalHosting && $VAR->domain->physicalHosting->errordocs) {
echo $VAR->includeTemplate('domain/service/errordocs.php') . "\n";
}
echo $VAR->includeTemplate('domain/service/suspend.php');

View File

@@ -1,99 +0,0 @@
<?php echo AUTOGENERATED_CONFIGS; ?>
<?php /** @var Template_VariableAccessor $VAR */ ?>
<?php
if (!$VAR->domain->webmail->isActive && !$VAR->domain->webmail->suspended) {
echo "# Webmail is not enabled on the domain\n";
return;
}
?>
<?php
$ipAddresses = $VAR->server->webserver->listenLocalhost ?
[$VAR->domain->webmail->loopbackIpAddress] :
$VAR->domain->webmail->ipAddresses;
?>
<?php foreach ($ipAddresses as $ipAddress): ?>
<VirtualHost <?php
echo "{$ipAddress->escapedAddress}:{$VAR->server->webserver->httpPort}";
echo ($VAR->server->webserver->proxyActive && $ipAddress->address !== '127.0.0.1') ? " 127.0.0.1:{$VAR->server->webserver->httpPort}" : "";
?>>
ServerName "webmail.<?php echo $VAR->domain->asciiName ?>"
<?php foreach ($VAR->domain->mailAliases as $alias): ?>
ServerAlias "webmail.<?php echo $alias->asciiName ?>"
<?php endforeach; ?>
UseCanonicalName Off
<?php if ($VAR->domain->webmail->suspended) {
echo $VAR->includeTemplate('webmail/suspend.php');
}?>
<?php switch ($VAR->domain->webmail->type) {
case 'atmail':
echo $VAR->includeTemplate('webmail/atmail.php');
break;
case 'horde':
echo $VAR->includeTemplate('webmail/horde.php');
break;
case 'roundcube':
echo $VAR->includeTemplate('webmail/roundcube.php');
break;
} ?>
<?php echo $VAR->includeTemplate('domain/PCI_compliance.php') ?>
<?=$VAR->domain->webmail->extensionsConfigs?>
</VirtualHost>
<?php endforeach; ?>
<?php if ($VAR->domain->webmail->sslCertificate): ?>
<IfModule mod_ssl.c>
<?php foreach ($ipAddresses as $ipAddress): ?>
<VirtualHost <?php
echo "{$ipAddress->escapedAddress}:{$VAR->server->webserver->httpsPort}";
echo ($VAR->server->webserver->proxyActive && $ipAddress->address !== '127.0.0.1') ? " 127.0.0.1:{$VAR->server->webserver->httpsPort}" : "";
?>>
ServerName "webmail.<?php echo $VAR->domain->asciiName ?>"
<?php foreach ($VAR->domain->mailAliases as $alias): ?>
ServerAlias "webmail.<?php echo $alias->asciiName ?>"
<?php endforeach; ?>
UseCanonicalName Off
<?php $sslCertificate = $VAR->domain->webmail->sslCertificate; ?>
<?php if ($sslCertificate->ceFilePath): ?>
SSLEngine on
SSLVerifyClient none
SSLCertificateFile <?php echo $sslCertificate->ceFilePath ?>
<?php if ($sslCertificate->caFilePath): ?>
SSLCACertificateFile <?php echo $sslCertificate->caFilePath ?>
<?php endif; ?>
<?php endif; ?>
<?php if ($VAR->domain->webmail->suspended) {
echo $VAR->includeTemplate('webmail/suspend.php');
}?>
<?php switch ($VAR->domain->webmail->type) {
case 'atmail':
echo $VAR->includeTemplate('webmail/atmail.php');
break;
case 'horde':
echo $VAR->includeTemplate('webmail/horde.php');
break;
case 'roundcube':
echo $VAR->includeTemplate('webmail/roundcube.php');
break;
default:
echo "# Using custom webmail type: '{$VAR->domain->webmail->type}'";
break;
} ?>
<?php echo $VAR->includeTemplate('domain/PCI_compliance.php') ?>
<?=$VAR->domain->webmail->extensionsConfigs?>
</VirtualHost>
<?php endforeach; ?>
</IfModule>
<?php endif ?>

View File

@@ -1,9 +0,0 @@
<?php if (!$VAR->server->webserver->apache->traceEnableCompliance): ?>
TraceEnable off
<?php endif; ?>
ServerTokens ProductOnly
SSLProtocol ALL -SSLv2 -SSLv3
SSLHonorCipherOrder on
SSLCipherSuite ALL:!aNULL:!ADH:!eNULL:!LOW:!EXP:RC4+RSA:+HIGH:+MEDIUM