Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Permenantly redirect devicemagic.com to www.devicemagic.com

  • Loading branch information...
commit 58fa2d2a28b21ccfdb2d38dace387f5f2e6d5477 1 parent 4946d21
@orangethunder orangethunder authored
View
2  cookbooks/main/recipes/default.rb
@@ -103,3 +103,5 @@
# postgresql9_pg_freespacemap "postgres"
#end
+
+require_recipe "nginx_rewrite"
View
15 cookbooks/nginx_rewrite/recipes/default.rb
@@ -0,0 +1,15 @@
+forms_production = node[:applications].keys.include?("mobileforms")
+ from = "devicemagic.com"
+ to = "www.devicemagic.com"
+
+ template "/etc/nginx/servers/mobileforms/custom.conf" do
+ source "custom.conf.erb"
+ owner node[:owner_name]
+ group node[:owner_name]
+ mode 0644
+ variables({
+ :from => from,
+ :to => to
+ })
+ end
+end
View
4 cookbooks/nginx_rewrite/templates/default/custom.conf.erb
@@ -0,0 +1,4 @@
+# This file was generated by a custom Device Magic chef recipe
+if ($host = '<%= @from %>' ) {
+ rewrite ^/(.*)$ http://<%= @to %>/$1 permanent;
+}
Please sign in to comment.
Something went wrong with that request. Please try again.