Symptoms
-
The following error message is shown:
[emerg] "proxy_read_timeout" directive is duplicate in /var/www/vhosts/system/example.com/conf/vhost_nginx.conf:1 nginx: configuration file /etc/nginx/nginx.conf test failed
when
-
adding proxy_read_timeout to the Additional nginx directives field at Domains > example.com > Apache & nginx settings;
-
opening the Home page in Plesk;
-
repairing the web-server configuration.
-
-
The max_execution_time value is customized at Domains > example.com > PHP Settings (Reset to Default option is shown):
-
Plesk repair utility fails with:
# plesk repair web
...
Template_Exception: nginx: [emerg] "proxy_read_timeout"
directive is duplicate in
/var/www/vhosts/system/example.com/conf/vhost_nginx.conf:2
nginx: configuration file /etc/nginx/nginx.conf test failed
Cause
Product issue:
-
#PPPM-12599 "Specifying custom values for both the proxy_read_timeout nginx directive and max_execution_time PHP setting for the same domain results in the max_execution_time value being substituted for the proxy_read_timeout value (e.g., adding proxy_read_timeout 1800; to “Apache&Nginx Settings” > “Additional Nginx directives” and setting max_execution_time to 90 in “PHP Settings” will result in proxy_read_timeout being set to 90 in the nginx configuration file for the domain in question)."
Fixed in:- Plesk Obsidian 23 November 2021 (Linux)
Resolution
Workaround
-
Apply one of the following steps to remove the duplicate directive:
-
Reset the max_execution_time value to default at Domains > example.com > PHP Settings and specify proxy_read_timeout in the Additional nginx directives field at Domains > example.com > Apache & nginx settings
-
Remove the proxy_read_timeout (if defined) from the Additional nginx directives field at Domains > example.com > Apache & nginx Settings and adjust max_execution_time in domain's PHP Settings.
Note: If there are a lot of domains with both directives customized, see the command-line instructions below.
-
-
Go to Tools & Settings > Webserver Configurations Troubleshooter
-
Click the button > Set the Status filter to Error from the drop-down menu.
- The list of broken configuration files will appear. Select all and click Rebuild > Selected.
-
Connect to the Plesk server via SSH.
-
Disable
proxy_read_timeout
for all domains with the command:# grep -rl "proxy_read_timeout" /var/www/vhosts/system/*/conf/ | xargs sed -i 's/proxy_read_timeout/#proxy_read_timeout/g'
-
Repair web-server configuration:
# plesk repair web -y