[chef] Nginx reverse proxy: where to put config


Chronological Thread 
  • From: Andrew Miklas < >
  • To:
  • Subject: [chef] Nginx reverse proxy: where to put config
  • Date: Mon, 7 Mar 2011 18:54:03 -0800

Hi all,

I'm trying to create a role that installs nginx using the "nginx" cookbook and configures it to reverse proxy a bunch of unicorn instances configured using the "application" cookbook.

I need to put an nginx config file into /etc/nginx/sites-available, but I'm not sure in which cookbook the template & associated recipe should live. There are three options, from what I can tell:

a) I could put it into the nginx cookbook. This would involve creating a recipe that looks somewhere (a node attribute, maybe?) for a role name, and then creates an nginx config file containing a vhost and an upstream block containing the addresses of all nodes in the named role. This puts logic into the nginx config that is reverse- proxy specific (which might not be so bad, I suppose).

b) I could put it into the application cookbook. But then this ties "application" to nginx, which seems wrong

c) I could create a new cookbook to contain the recipe and template to generate the config. This seems like it's overkill though.


Any ideas? My guess is that option (a) is the way to go, but it seems like this is something that would have come up before. Maybe I'm missing something obvious?


Thanks,


Andrew


------
Andrew Miklas
CTO & Founder, pagerduty.com
(650) 989-2965 x110




Archive powered by MHonArc 2.6.16.

§