Hello @IgorG , @Lloyd_mcse
Every morning arround 6am i get a nginx 502 on all websites hosted by plesk and to solve the problem i must to this (panel dont have any 502 error):
http://kb.odin.com/de/123735
After that all works good until the next morning.
The nginx logs are empty but i remarked this error in proxy_error_log:
Is is maybe a solution to write this into nginx directives from every webspace:
proxy_buffer_size 128k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;
What can i do to fix this problem on debian jessie permently?
EDIT the only thing i have changed is the "nginxDomainVirtualHost.php" (custom):
Adding this into it:
<?php if ($sslCertificate->ce): ?>
ssl_certificate <?php echo $sslCertificate->ceFilePath ?>;
ssl_certificate_key <?php echo $sslCertificate->ceFilePath ?>;
ssl_session_cache shared:SSL:5m;
ssl_dhparam /etc/ssl/RSA2048.pem;
Maybe the 2 rows in bold are not on the correct place that it makes an error?
Thanks
Every morning arround 6am i get a nginx 502 on all websites hosted by plesk and to solve the problem i must to this (panel dont have any 502 error):
http://kb.odin.com/de/123735
After that all works good until the next morning.
The nginx logs are empty but i remarked this error in proxy_error_log:
2015/11/12 09:17:47 [error] 31126#0: *13 connect() failed (111: Connection refused) while connecting to upstream, client: 35.0.127.52, server: domain.tld, request: "GET /favicon.ico HTTP/1.1", upstream: "https://IP:7081/favicon.ico", host: "domain.tld"
Is is maybe a solution to write this into nginx directives from every webspace:
proxy_buffer_size 128k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;
What can i do to fix this problem on debian jessie permently?
EDIT the only thing i have changed is the "nginxDomainVirtualHost.php" (custom):
Code:
<?php
/**
* @var Template_VariableAccessor $VAR
* @var array $OPT
*/
?>
server {
listen <?php echo $OPT['ipAddress']->escapedAddress . ':' . $OPT['frontendPort'] .
($OPT['default'] ? ' default_server' : '') . ($OPT['ssl'] ? ' ssl' : '') ?>;
server_name <?php echo $VAR->domain->asciiName ?>;
<?php if ($VAR->domain->isWildcard): ?>
server_name ~^<?php echo $VAR->domain->pcreName ?>$;
<?php else: ?>
server_name www.<?php echo $VAR->domain->asciiName ?>;
<?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): ?>
server_name <?php echo $alias->asciiName ?>;
server_name www.<?php echo $alias->asciiName ?>;
<?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->ce): ?>
ssl_certificate <?php echo $sslCertificate->ceFilePath ?>;
ssl_certificate_key <?php echo $sslCertificate->ceFilePath ?>;
ssl_session_cache shared:SSL:5m;
ssl_dhparam /etc/ssl/RSA2048.pem;
<?php if ($sslCertificate->ca): ?>
ssl_client_certificate <?php echo $sslCertificate->caFilePath ?>;
<?php endif ?>
<?php endif ?>
<?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->physicalHosting->scriptTimeout): ?>
proxy_read_timeout <?php echo min($VAR->domain->physicalHosting->scriptTimeout, 2147483); ?>;
<?php endif; ?>
root "<?php echo $OPT['ssl'] ? $VAR->domain->physicalHosting->httpsDir : $VAR->domain->physicalHosting->httpDir ?>";
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['default']): ?>
<?php echo $VAR->includeTemplate('service/nginxSitePreview.php') ?>
<?php endif ?>
<?php echo $VAR->domain->physicalHosting->proxySettings['allowDeny'] ?>
<?php echo $VAR->includeTemplate('domain/service/nginxSeoSafeRedirects.php', array('ssl' => $OPT['ssl'])); ?>
location / {
<?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 endif ?>
<?php if ($VAR->domain->active && !$VAR->domain->physicalHosting->proxySettings['nginxTransparentMode']): ?>
<?php if ($VAR->domain->physicalHosting->php && $VAR->domain->physicalHosting->proxySettings['nginxServePhp']
|| $VAR->domain->physicalHosting->proxySettings['nginxServeStatic']): ?>
<?php if ($VAR->domain->physicalHosting->proxySettings['fileSharingPrefix']): ?>
location ~ ^/<?php echo $VAR->domain->physicalHosting->proxySettings['fileSharingPrefix'] ?>/ {
<?php echo $VAR->includeTemplate('domain/service/proxy.php', $OPT); ?>
}
<?php endif; ?>
<?php endif; ?>
<?php if ($VAR->domain->physicalHosting->proxySettings['nginxServeStatic']): ?>
location @fallback {
<?php echo $VAR->includeTemplate('domain/service/proxy.php', $OPT); ?>
}
<?php echo $VAR->includeTemplate('domain/service/nginxProtectedDirectories.php', $OPT); ?>
location ~ ^/(.*\.(<?php echo $VAR->domain->physicalHosting->proxySettings['nginxStaticExtensions'] ?>))$ {
try_files $uri @fallback;
}
<?php endif ?>
<?php if ($VAR->domain->physicalHosting->php && $VAR->domain->physicalHosting->proxySettings['nginxServePhp']): ?>
<?php if ($VAR->domain->physicalHosting->hasWebstat): ?>
location ~ ^/(plesk-stat|webstat|webstat-ssl|ftpstat|anon_ftpstat|awstats-icon) {
<?php echo $VAR->includeTemplate('domain/service/proxy.php', $OPT); ?>
}
<?php endif; ?>
location ~ ^/~(.+?)(/.*?\.php)(/.*)?$ {
alias <?php echo $VAR->domain->physicalHosting->webUsersDir ?>/$1/$2;
<?php echo $VAR->includeTemplate('domain/service/fpm.php'); ?>
}
location ~ ^/~(.+?)(/.*)?$ {
<?php echo $VAR->includeTemplate('domain/service/proxy.php', $OPT); ?>
}
<?php echo $VAR->includeTemplate('domain/service/nginxWordpress.php', $OPT); ?>
location ~ \.php(/.*)?$ {
<?php echo $VAR->includeTemplate('domain/service/fpm.php'); ?>
}
<?php echo $VAR->includeTemplate('domain/service/nginxWordpressIndexing.php', $OPT); ?>
location ~ /$ {
<?php echo $VAR->domain->physicalHosting->proxySettings['directoryIndex'] ?>
}
<?php endif ?>
<?php endif ?>
<?php if (is_file($VAR->domain->physicalHosting->customNginxConfigFile)): ?>
include "<?php echo $VAR->domain->physicalHosting->customNginxConfigFile ?>";
<?php endif; ?>
}
Adding this into it:
<?php if ($sslCertificate->ce): ?>
ssl_certificate <?php echo $sslCertificate->ceFilePath ?>;
ssl_certificate_key <?php echo $sslCertificate->ceFilePath ?>;
ssl_session_cache shared:SSL:5m;
ssl_dhparam /etc/ssl/RSA2048.pem;
Maybe the 2 rows in bold are not on the correct place that it makes an error?
Thanks
Last edited: