As you know when you install nginx, it comes with default pool called www
and a default site called default
.
How can I safely remove these two? Because I have created a new pool and site and I want to release some resources by deleting these.
As you know when you install nginx, it comes with default pool called www
and a default site called default
.
How can I safely remove these two? Because I have created a new pool and site and I want to release some resources by deleting these.
Your file locations and service names might be a bit different, but you just need to delete the two configs and reload:
/etc/php/7.0/fpm/pool.d/www.conf
/etc/nginx/sites-available/default
and its symlink/etc/nginx/sites-enabled/default
sudo service nginx reload
sudo service php7.0-fpm reload
You could also leave
www.conf
as a template for later use:mv /etc/php/7.0/fpm/pool.d/www.conf /etc/php/7.0/fpm/pool.d/www.conf.template
sudo service php7.0-fpm reload
This way default config is still present and can be used as a template for other pool configurations. The file itself won't be used to create a php pool as it does not meet the
include
directive in/etc/php/7.0/fpm/php-fpm.conf
:include=/etc/php/7.0/fpm/pool.d/*.conf
If you are looking to remove default ngnix file only and not php pool, then you can follow this answer. I am writing this assuming the server as ubuntu. Files location may be a little different for different machines. You just need to remove default server configuration from sites-available and sites-enabled. Follow these instructions :
sudo cd /etc/nginx/sites-enabled
.sudo rm -f default
.sudo cd /etc/nginx/sites-available
.sudo rm -f default
.sudo nginx -t && nginx -s reload
If it does not show any error, proves entries done by you have been accepted and you have removed the default server file done by ngnix.