Created
October 30, 2012 08:40
-
-
Save krasio/3979033 to your computer and use it in GitHub Desktop.
Simple Chef recipe to customize Nginx configuration on Engine Yard App Cloud
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# cookbooks/nginx-custom/templates/default/custom.conf.erb | |
rewrite ^/members/(.*)/blog_entries/(.*)$ /members/$1/blog/$2 permanent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# cookbooks/nginx-custom/recipes/default.rb | |
# | |
# Cookbook Name: nginx-custom | |
# Recipe: default | |
# | |
if (['app_master', 'app'].include?(node[:instance_role])) | |
node[:engineyard][:environment][:apps].each do |app| | |
template "/etc/nginx/servers/#{app[:name]}/custom.conf" do | |
source 'custom.conf.erb' | |
owner node[:users][0][:username] | |
group node[:users][0][:username] | |
mode 0644 | |
end | |
execute "sudo /etc/init.d/nginx reload" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment