Permalink
Browse files

Updated Nginx recipe to work for EY Documentation

  • Loading branch information...
1 parent ebae011 commit cb709595f7d886118bc8d105e7078abd90dc2a77 Danish Khan committed Apr 28, 2011
View
1 cookbooks/gollum/recipes/default.rb
@@ -2,6 +2,7 @@
# Cookbook Name:: gollum
# Recipe:: default
#
+
execute "stop nginx" do
command "/etc/init.d/nginx stop"
only_if "/etc/init.d/nginx status"
View
5 cookbooks/main/recipes/default.rb
@@ -62,7 +62,7 @@
#uncomment to include the eybackup_verbose recipe
#require_recipe "eybackup_verbose"
-#require_recipe 'nginx'
+require_recipe 'nginx'
#uncomment to include the mysql_replication_check recipe
#require_recipe "mysql_replication_check"
@@ -72,4 +72,5 @@
#require_recipe "mysql_administrative_tools"
require_recipe "gollum"
-require_recipe "rubygems"
+require_recipe "rubygems"
+# require_recipe "redis"
View
48 cookbooks/nginx/files/default/EY_Documentation.conf
@@ -0,0 +1,48 @@
+server {
+ listen 80;
+
+ server_name _;
+
+
+ client_max_body_size 100M;
+
+ location ~* ^.+\.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|pdf|txt|tar|wav|bmp|rtf|js|flv|swf|html|htm)$
+ {
+ root /data/EY_Documentation/current/_site;
+ }
+ access_log /var/log/engineyard/nginx/EY_Documentation.access.log main;
+
+ error_log /var/log/engineyard/nginx/EY_Documentation.error.log notice;
+
+ passenger_enabled on;
+
+ rack_env production;
+
+ include /etc/nginx/servers/EY_Documentation.rewrites;
+
+ include /etc/nginx/servers/EY_Documentation/custom.locations.conf;
+
+ # This allows people to use images and css in their maintenance.html file
+ if ($request_filename ~* \.(css|jpg|gif|png)$) {
+ break;
+ }
+
+ # Rewrite all the requests to the maintenance.html page if it exists.
+ if (-f $document_root/system/maintenance.html) {
+ return 503;
+ }
+
+ # set Expire header on assets: see http://developer.yahoo.com/performance/rules.html#expires
+ location ~ ^/(images|javascripts|stylesheets)/ {
+ expires 10y;
+ }
+
+ error_page 404 /404.html;
+ error_page 500 502 504 /500.html;
+
+ error_page 503 @503;
+ location @503 {
+ rewrite ^(.*)$ /system/maintenance.html break;
+ }
+
+}
View
21 cookbooks/nginx/recipes/default.rb
@@ -1,13 +1,8 @@
-enable_package "www-servers/nginx" do
- version "0.7.65-r4"
-end
-
-package "www-servers/nginx" do
- version "0.7.65-r4"
- action :install
-end
-
-service "nginx" do
- supports :status => true, :stop => true, :restart => true, :staus => true
- action :restart
-end
+remote_file "/etc/nginx/servers/EY_Documentation.conf" do
+ owner "root"
+ group "root"
+ mode 0755
+ source "EY_Documentation.conf"
+ backup false
+ action :create
+end

0 comments on commit cb70959

Please sign in to comment.