• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Question nginxDomainVirtualHost.php - configure ipv6

MartinT

Basic Pleskian
Server operating system version
Debian 10.13 Buster
Plesk version and microupdate number
Plesk Obsidian Version 18.0.48
Hi there,

my question is about /usr/local/psa/admin/conf/templates/default/domain/nginxDomainVirtualHost.php.

I want to create a custom one for it, that will write the ipv6 to the domian-conf files.
The default one look like this at my plesk obsidian installation:
<?php
/**
* @var Template_VariableAccessor $VAR
* @var array $OPT
*/
?>
<?php if ($VAR->domain->isSeoRedirectToLanding || $VAR->domain->isSeoRedirectToWww || $VAR->domain->isAliasRedirected): ?>
server {
listen <?php echo $OPT['ipAddress']->escapedAddress . ':' . $OPT['frontendPort'] . ($OPT['ssl'] ? ' ssl' : ''); ?>;

<?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 ?>;
These are the beginning lines. So my question: The "Listen to" with port is specificated at line 9:
listen <?php echo $OPT['ipAddress']->escapedAddress . ':' . $OPT['frontendPort'] . ($OPT['ssl'] ? ' ssl' : ''); ?>;
What has to be at line 10 to get the "Listen to" for the IPv6?

Each Domain and subscription got its own IPv6 address and the serverwide IPv4 Address.

Thanks for help.
Martin
 
Any idea? I thinh it is about this part: ['ipAddress']

I might just copy it and set the right value for ipv6. But where I could get the name of value.

Is it ip6Address, ipv6Address, ipAddress-v6.....?
 
It is ['ipAddress'] and if you select an IPv6 address for a website, it will automatically create an nginx server {} config with that selected IPv6 address
Plesk does not use multiple listen statements in one server/virtualhost segment, but create a dedicated for every IP and port combination.
So in general you will see four virtual servers for every website that has IPv4 and IPv6 (each IP once with port 80 and once with 443)
And to build the complete nginx config file for such a website, this template gets called four times.

That is why I don't see the need to adjust this template file it, makes no sense to me in the current scenario
 
It is ['ipAddress'] and if you select an IPv6 address for a website, it will automatically create an nginx server {} config with that selected IPv6 address
Plesk does not use multiple listen statements in one server/virtualhost segment, but create a dedicated for every IP and port combination.
So in general you will see four virtual servers for every website that has IPv4 and IPv6 (each IP once with port 80 and once with 443)
And to build the complete nginx config file for such a website, this template gets called four times.

That is why I don't see the need to adjust this template file it, makes no sense to me in the current scenario
Thanks for your answer.

I got one error message in Web Configuration Troubleshooter in my Plesk Backend. And a search did not resolve a solvation for the problem. So I tried to look at this error message e.g ginx: [warn] conflicting server name “example.com” on 203.0.113.2:80, ignored nginx: and my opinion was, there has to be something wrong with the default template. Each domian got the server IPv4 and additional a individual ipv6.

Now again I seached with pats ond other parts of this error message and I found a plesk solution at: Error in Plesk: New configuration files for the Apache web server were not created due to the errors in configuration templates - Support Cases from Plesk Knowledge Base
So in a calm minute I will try out this solution, maybe it solve this error message.

In case that my errors message don't has any ipv4 addresses but all ipv6 address, I concluded that there is something wrong in the default template and ipv6.
The server works fine, and all ipv6 are reachable, nginx is fine, so I don't think it is a issue with the IP-Adresses.
 
Back
Top