]> git.openstreetmap.org Git - chef.git/commitdiff
imagery: add default site for socket settings
authorGrant Slater <git@firefishy.com>
Wed, 1 Jun 2016 22:57:18 +0000 (23:57 +0100)
committerGrant Slater <git@firefishy.com>
Wed, 1 Jun 2016 22:59:27 +0000 (23:59 +0100)
cookbooks/imagery/recipes/default.rb
cookbooks/imagery/templates/default/nginx_default.conf.erb [new file with mode: 0644]
cookbooks/imagery/templates/default/nginx_imagery.conf.erb

index d7827173b068910619de31c7db4405e9888707a3..946a4fdeef84cd70ebf596a1dfc99183e7e8b38d 100644 (file)
@@ -74,7 +74,8 @@ execute "unzip-ostn02-ntv2-data" do
 end
 
 nginx_site "default" do
-  action [:delete]
+  template "nginx_default.conf.erb"
+  directory "/srv/imagery/default"
   restart_nginx false
 end
 
diff --git a/cookbooks/imagery/templates/default/nginx_default.conf.erb b/cookbooks/imagery/templates/default/nginx_default.conf.erb
new file mode 100644 (file)
index 0000000..d3b8584
--- /dev/null
@@ -0,0 +1,6 @@
+server {
+    listen 80 fastopen=1024 default_server;
+    server_name  _;
+    return 404 'default imagery server vhost. Please use correct URL.';
+    add_header Content-Type text/plain;
+}
index b24989185a626f7096bae692181ec5381d08451b..b369409735a7466a5fabbf80e27fd6d23dc3d54b 100644 (file)
@@ -1,5 +1,5 @@
 server {
-    listen       80 fastopen=1024;
+    listen 80;
     server_name  <%= @name %> a.<%= @name %> b.<%= @name %> c.<%= @name %><% @aliases.each do |alias_name| %> <%= alias_name %> a.<%= alias_name %> b.<%= alias_name %> c.<%= alias_name %><%- end -%>;
 
     root "/srv/<%= @name %>";