- Plesk for Linux
How to add additional nginx directives globally, so that these directives will not be overwritten after updates?
Connect to a Plesk server via SSH.
Create the file directives.conf inside the directory /etc/nginx/conf.d/:
# touch /etc/nginx/conf.d/directives.conf
Open the file /etc/nginx/conf.d/directives.conf in a text editor and add required directives. For example:
# cat /etc/nginx/conf.d/directives.conf
proxy_buffers 8 16k;
fastcgi_buffers 8 16k;
Make sure that the new directives do not break the nginx configuration:
# nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
Reload nginx configuration to apply the changes:
# service nginx reload