• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Resolved nginx protocol options redefined

Tim_Wakeling

Basic Pleskian
Server operating system version
AlmaLinux 8.8
Plesk version and microupdate number
18.0.53
On my server with nginx 1.24 I am getting the following red errors:

Unable to configure the web server: Execution failed. Command: httpdmng Arguments: Array ( [0] => --reconfigure-all [1] => -skip-removing ) Details: Execution failed. Command: httpdmng Arguments: Array ( [0] => --reconfigure-domains [1] => <list of all my domains here> ) Details: [2023-06-12 09:32:34.693] 1765631:6486e5f08831f ERR [util_exec] proc_close() failed ['/usr/local/psa/admin/bin/nginx-config' '-t'] with exit code [1] [2023-06-12 09:33:02.823] 1765631:6486e5f08831f ERR [panel] Apache config (16865622850.14422000) generation failed: Template_Exception: nginx: [warn] protocol options redefined for 193.33.178.154:443 in /etc/nginx/plesk.conf.d/vhosts/my-domain.com.conf:20 nginx: [warn] protocol options redefined for 193.33.178.154:443 in /etc/nginx/plesk.conf.d/vhosts/my-next-domain.com.conf:6 nginx: [warn] protocol options redefined for 193.33.178.154:443 in /etc/nginx/plesk.conf.d/vhosts/my-next-domain.com.conf:20 ...

... and this error continues with the same error for each of all my domains.

Looking in the conf files concerned, I see the following:

server {
listen 193.33.178.154:443 ssl;

ssl_certificate /usr/local/psa/var/certificates/scfKHcXRu;
ssl_certificate_key /usr/local/psa/var/certificates/scfKHcXRu;

server_name www.my-domain.com;

location / {
return 301 https://my-domain.com$request_uri;
}

}

server {
listen 193.33.178.154:443 ssl http2;

server_name my-domain.com;
server_name ipv4.my-domain.com;

ssl_certificate /usr/local/psa/var/certificates/scfKHcXRu;
ssl_certificate_key /usr/local/psa/var/certificates/scfKHcXRu;

... etc.

Googling suggests I should add "http2" to the "listen" command but it seems already to be there, at least on the second one in each domain.

The text in the conf file also suggests I shouldn't edit it anyway as it's automatically generated.

Any ideas? Thank you! Google is not helping me on this one.

Tim
 
Maybe you habe an additional nginx configuration file in /etc/nginx/conf.d that is included.
 
the nginx -t command is used to check the validity of the nginx config files prior to restarting nginx. It could be you have a syntax error or a conflict in how your ports are defined somewhere in one of your server directives. You can always login to the system with SSH with a user that has sudo privileges and run the command nginx -t to see the error details.
 
the nginx -t command is used to check the validity of the nginx config files prior to restarting nginx. It could be you have a syntax error or a conflict in how your ports are defined somewhere in one of your server directives. You can always login to the system with SSH with a user that has sudo privileges and run the command nginx -t to see the error details.
Thanks for the tip! But when I type nginx -t I just get a readout of the errors I posted above, i.e. the following two lines for every domain on my server:

nginx: [warn] protocol options redefined for 193.33.178.154:443 in /etc/nginx/plesk.conf.d/vhosts/domain.com.conf:6
nginx: [warn] protocol options redefined for 193.33.178.154:443 in /etc/nginx/plesk.conf.d/vhosts/domain.com.conf:20

Line 6 of each file says:
listen 193.33.178.154:443 ssl;

and line 20 of each file says:
listen 193.33.178.154:443 ssl http2;
 
Those are the errors you need to correct. The result of the nginx-t command is telling you the error, the file where it is located, and the line on which it exists. I'm not going to be able to help you fix the errors, but now you know what to fix.
 
Have you checked where you have "listen 193.33.178.154:443 ssl" line in addition to the individual virtual host configurations? Have you checked /etc/nginx/conf.d? Did you modify your main nginx configuration file maybe?
 
I have the same issue. some domains have this warning - I have no extra config in /etc/nginx/conf.d/ or in the main nginx config file.
Its affecting subscriptions with alias domains which redirect to the main domain.
see this plesk generated config:
1686958285541.png
and the plesk generated part for the alias domain (top) is missing http2 in the listen directive.
it seems that this only "recently" started to produced warnings - because the same config with nginx 1.20.2 does not produce a [warn]

@IgorG: seems like a bug in the alias nginx config code generation to me?
 
It has been identified as a product issue. We are working on a solution. We have some suggestions for workarounds. One is to set the "preferred domain" in "Hosting Settings" of the affected domain(s) to "none". Could you please try that and report back here if it helps?
 
One is to set the "preferred domain" in "Hosting Settings" of the affected domain(s) to "none". Could you please try that and report back here if it helps?
no it does not change anything about the warning, it only adds some additional server_name entries to the upper "offending" server section.
 
@TobiasP Do you really have the exact same error message as in the first post of this thread? Else it is a different issue and needs its own thread.
 
yes I have also lots of these lines:
Code:
nginx: [warn] protocol options redefined for 192.168.101.1:443 in /etc/nginx/plesk.conf.d/vhosts/xxxx.at.conf:6
nginx: [warn] protocol options redefined for 192.168.101.1:443 in /etc/nginx/plesk.conf.d/vhosts/xxxx.at.conf:23
 
If you are not using Kolab, please open a support ticket with Plesk support, because then it needs to be investigated on your server, because it is probably an unknown issue.
 
If you are not using Kolab, please open a support ticket with Plesk support, because then it needs to be investigated on your server, because it is probably an unknown issue.
okay but @Tim_Wakeling also does not seem to use kolab so my problem is exactly the same as his. but I will try to open a new support ticket.
but it seems its a problem with
/usr/local/psa/admin/conf/templates/default/domain/nginxDomainVirtualHost.php
Line 9 is missing the http2 directive code that is present on Line 48
 
I have the same problem

in my case, I added a file to optimize nginx in the folder /etc/nginx/conf.d

but I'm not sure if that was the reason the problem appeared.

delete the file and restart the server but the problem persists
 
It has been identified as a product issue. We are working on a solution. We have some suggestions for workarounds. One is to set the "preferred domain" in "Hosting Settings" of the affected domain(s) to "none". Could you please try that and report back here if it helps?
I will try this, thank you - and will review all the further replies to this thread for clues. Thanks to others for joining in with your thoughts! It looks like I am not alone with this problem and hopefully a solution will be found.
 
I will try this, thank you - and will review all the further replies to this thread for clues. Thanks to others for joining in with your thoughts! It looks like I am not alone with this problem and hopefully a solution will be found.
It has been identified as a product issue. We are working on a solution. We have some suggestions for workarounds. One is to set the "preferred domain" in "Hosting Settings" of the affected domain(s) to "none". Could you please try that and report back here if it helps?
Yes, it does seem to remove the error! I will set all my domains to "none" for now.
 
okay but @Tim_Wakeling also does not seem to use kolab so my problem is exactly the same as his. but I will try to open a new support ticket.
but it seems its a problem with
/usr/local/psa/admin/conf/templates/default/domain/nginxDomainVirtualHost.php
Line 9 is missing the http2 directive code that is present on Line 48
Just to say, @TobiasP - you're right, I don't use Kolab either.
 
Back
Top