[chef] Re: Nginx cookbook usage help


Chronological Thread 
  • From: Dan Crosta < >
  • To:
  • Subject: [chef] Re: Nginx cookbook usage help
  • Date: Thu, 2 Aug 2012 08:19:44 -0400

On Aug 2, 2012, at 7:28 AM, Morgan Blackthorne wrote:
I've got the nginx cookbook in place now, but I'm a little fuzzy on how to proceed next. I bootstrapped a node and it configured nginx with all the defaults. I wrote my own config block which I would like to either:
  • place in /etc/nginx/sites-available
  • create a symlink to it in /etc/nginx/sites-enabled
  • disable the /etc/nginx/sites-enabled/default symlink
You can drop a file in /etc/nginx/sites-available, and then use

    nginx_site "name-of-your-file-in-sites-available" do
      enable true
    end

to have Chef enable the site for you (reloading nginx's configuration as appropriate)


Or, to just replace the default config block directly and save the hassle of mucking around with multiple files.

What's the best way to go about this?

Recent versions of the nginx cookbook have an attribute node["nginx"]["default_site_enabled"] which you can set to false to disable the default site. You can then use the above recommendation to institute your own default site. You can set this from a recipe, role, environment, etc.


- Dan




Archive powered by MHonArc 2.6.16.

§