From be85823d780f36df6cda0403657854597ffcd936 Mon Sep 17 00:00:00 2001 From: Grant Slater Date: Sun, 31 Jan 2016 22:39:42 +0000 Subject: [PATCH] Imagery - restart nginx on fragment change --- cookbooks/imagery/resources/layer.rb | 4 ++++ .../templates/default/nginx_imagery_layer_fragment.conf.erb | 1 + 2 files changed, 5 insertions(+) diff --git a/cookbooks/imagery/resources/layer.rb b/cookbooks/imagery/resources/layer.rb index 25bcd7b4b..340ed0b6c 100644 --- a/cookbooks/imagery/resources/layer.rb +++ b/cookbooks/imagery/resources/layer.rb @@ -100,3 +100,7 @@ action :delete do action :delete end end + +def after_created + notifies :restart, "service[nginx]" +end diff --git a/cookbooks/imagery/templates/default/nginx_imagery_layer_fragment.conf.erb b/cookbooks/imagery/templates/default/nginx_imagery_layer_fragment.conf.erb index 18be9f533..041870b6a 100644 --- a/cookbooks/imagery/templates/default/nginx_imagery_layer_fragment.conf.erb +++ b/cookbooks/imagery/templates/default/nginx_imagery_layer_fragment.conf.erb @@ -5,6 +5,7 @@ location ~* "^/layer/<%= @layer %>/(\d+)/(\d+)/(\d+)\.(png|jpg|jpeg)$" { fastcgi_param QUERY_STRING "map=/srv/imagery/mapserver/layer-<%= @layer %>.map&mode=tile&layers=<%= @layer %>&tilemode=gmap&tile=$2+$3+$1"; fastcgi_pass "unix:/var/run/mapserver-fastcgi/layer-<%= @layer %>.socket"; include fastcgi_params; + gzip off; } -- 2.39.5