Applicable to:
- Plesk for Linux
Symptoms
Adding location /
to Domains > example.com > Apache & nginx > Additional nginx directives fails
Invalid nginx configuration: nginx: [emerg] duplicate location "/" in /data/www/system/example.com/conf/vhost_nginx.conf:1 nginx: configuration file /etc/nginx/nginx.conf test failed
Cause
The location /
is already defined in the main domain configuration file when nginx is set up as a reverse proxy.
Resolution
Note: If the directives are for enabling WordPress permalinks, use this article: 404 Not Found after switching WordPress to FPM by nginx
To add location /
to additional nginx directives:
-
Go to Domains > example.com > Apache & nginx directives
-
Temporarily remove the additional nginx directive that has
location /
-
Disable Proxy Mode and click Apply
-
Add the directive back to Additional nginx directives and click Apply
The following documentation shows how to create custom templates for the virtual hosts:
Changing Virtual Hosts Settings Using Configuration Templates
Warning: The changes in the virtual hosts configuration templates are applied to all domains on the server.
Comments
0 comments
Please sign in to leave a comment.