Nginx configuration with AWS Opsworks

1.1k views Asked by At

I've installed the openresty cookbook, but now I need to install my config files. What is the best way to add my nginx.conf and nginx.lua files using Chef?

1

There are 1 answers

0
coderanger On BEST ANSWER

You'll want to write your vhost files using a template resource generally:

template "#{node['openresty']['dir']}/sites-enabled/mysite.conf" do
  source 'mysite.conf.erb'
  owner 'root'
  group 'root'
  mode '644'
  notifies :reload, node['openresty']['service']['resource']
end

I'm unfamiliar with how openresty does lua plugin configs but I would guess it is similar. Make your own cookbook for mysite that depends on the openresty cookbook and then put your templates in that that cookbook. Don't forget to add your new cookbook to the run list too.