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,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>