Plesk for Linux
kb: bug
ABT: Group B
Applicable to:
- Plesk for Linux
Symptoms
Cannot simultaneously disable Proxy Mode and add nginx directive containing location /
in Domains > example.com > Apache & nginx Settings:
PLESK_ERROR: Invalid nginx configuration: nginx: [emerg] duplicate location "/" in /var/www/vhosts/system/example.com/conf/vhost_nginx.conf:1 nginx: configuration file /etc/nginx/nginx.conf test failed
Cause
This is a Plesk bug with ID PPPM-9841 which is planned to be fixed in future product updates.
Resolution
As a workaround until fix available:
-
In Domains > example.com > Apache & nginx directives temporary remove additional nginx directive containing
location /
; -
Disable Proxy Mode and click Apply;
-
Insert the necessary directive back into Additional nginx directives and click Apply;
Comments
4 comments
This used to work for me but now for some reason it does not anymore. When I check /var/www/vhosts/system/example.com/conf/vhost_nginx.conf it does not contain location / directive and thus it does work. But I still get an email with plesk wanting to regenerate the files and a message on the "home" dashboard as well.
I think the reason for try-to-fix-but-instead-really-messed-up is PPPM-6752.
@Sven Janssen,
If you still experience any issues, please submit a request to our Plesk Technical Support so they may check the issue thoroughly.
Well unfortunately I got Plesk via my provider and cannot submit a ticket. The problem still persists.
To get an override for location /, I uncheck the "proxy" and cut the directive so it is empty and hit apply. Then I paste the directive and hit okay. Everything works until plesk regenerates the configs for whatever reason and then it breaks.
OSDebian 9.12, ProductPlesk Obsidian
Version 18.0.25, last updated on Mar 20, 2020 02:32 PM
Message says:
New configuration files for the Apache web server were not created due to the errors in configuration templates: nginx: [emerg] duplicate location "/" in /var/www/vhosts/system/domain.tld/conf/vhost_nginx.conf:1 nginx: configuration file /etc/nginx/nginx.conf test failed . Detailed error descriptions were sent to you by email. Please resolve the issues and click here to generate broken configuration files once again or here to generate all configuration files. See the details in Configuration Troubleshooter
nginx:
location / {
proxy_set_header Host $http_host;
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_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_pass http://localhost:1234;
autoindex off;
}
Hi Sven Janssen,
Then you must be able to open a support request to your provider about Plesk or get a Support subscription.
Please sign in to leave a comment.