- 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 directives.conf file inside the
# touch /etc/nginx/conf.d/directives.conf
Now, open the created
/etc/nginx/conf.d/directives.conffile in a text editor. In this example, we use the vi editor:
# vi /etc/nginx/conf.d/directives.conf
Add required directives. For example:
# cat /etc/nginx/conf.d/directives.conf
proxy_buffers 8 16k;
fastcgi_buffers 8 16k;
Save the changes and close the file.
Make sure that the new directives do not break 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
Please sign in to leave a comment.