title: How to disable default nginx site when using Chef and Vagrant?
body: <p>I am using Berkshelf, Chef and Vagrant and I am trying to configure a custom site running on nginx. I am using the opscode nginx recipe and then writing my own recipe for the custom site. When I run vagrant up I get the an error about not disabling the default nginx site. I've found several different suggestions but nothing seems to be working. </p>
  
  <p>The error:</p>
  
  <pre><code>STDOUT:
  STDERR: nginx: [emerg] a duplicate default server for 0.0.0.0:80 in /etc/nginx/sites-    enabled/kyleboon.me:2
  nginx: configuration file /etc/nginx/nginx.conf test failed
  </code></pre>
  
  <p>My Berksfile:</p>
  
  <pre><code>site :opscode
  
  metadata
  cookbook 'nginx'
  </code></pre>
  
  <p>The 'roles/web.json' role I defined:</p>
  
  <pre><code>{
    "name": "web",
    "chef_type": "role",
    "json_class": "Chef::Role",
    "description": "The base role for systems that serve HTTP traffic",
    "default_attributes": {
      "nginx": {
        "default_site_enabled": false
      },
      "app": {
        "name": "kyleboon.me",
        "web_dir": "/var/data/www/kyleboon.me"
      },
      "user":{
        "name": "vagrant"
      }
    },
    "run_list": [
      "recipe[nginx]",
      "recipe[kyleboon.me]"
    ]
  }
  </code></pre>
  
  <p>Here is the recipes/default/default.rb for the nginx site I am adding:</p>
  
  <pre><code>nginx_site 'default' do
    action :disable
  end
  
  %w(public logs).each do |dir|
    directory "#{node.app.web_dir}/#{dir}" do
      owner node.user.name
      mode "0755"
      recursive true
    end
  end
  
  template "#{node.nginx.dir}/sites-available/kyleboon.me" do
    source "site.erb"
    mode 0777
    owner node.nginx.user
    group node.nginx.user
  end
  
  nginx_site "kyleboon.me"
  
  cookbook_file "#{node.app.web_dir}/public/index.html" do
    source "index.html"
    mode 0755
    owner node.user.name
  end
  </code></pre>
  
  <p>(P.S. I know the file permissions need to be changed, I've just been fiddling with lots of things, I'll update those once I get everything else working)</p>
  
  <p>And here is attributes/default.rb:</p>
  
  <pre><code>override['nginx']['enable_default_site'] = false
  </code></pre>
  
  <p>You can see I have tried to disable the default site in the web.json, the attributes and the recipe itself but none of them stick. </p>
  
  <p>I don't have a node or solo node defined and I'm not sure if that's an issue. My main problem with vagrant so far has been the endless possibilities for how to do things. No two examples are done in the same way and I'm not sure what is considered the 'best' or 'right' way to go. </p>