How to disable default nginx site when using Chef and Vagrant? How to disable default nginx site when using Chef and Vagrant? nginx nginx

How to disable default nginx site when using Chef and Vagrant?


You can disable any nginx site by name using the nginx_site and its name. The problem you are having is because the nginx_site definition is actually looking for the enable parameter to be set to true or false not the action parameter set to :disabled.

To disable the default site add to your recipe:

nginx_site 'default' do  enable falseend

This is working for me as of version 1.7.1 of the nginx opscode cookbook. I dont know if this will work with the version provided by community as it appears to be several months old.

To get the latest version add to your Berksfile:

cookbook 'nginx', git: 'https://github.com/opscode-cookbooks/nginx'

Hope that helps :)


I'm getting the same error, but I don't have the default site enabled. Instead, it's coming from /etc/nginx/conf.d/default.conf! I had to resort to

file "/etc/nginx/conf.d/default.conf" do  action :deleteend

This is coming from the RHEL package that the nginx cookbook is installing on my box.