From b986944def2a1e9fedc0e9f04e2aaea69bd4a115 Mon Sep 17 00:00:00 2001 From: Grant Slater Date: Tue, 2 Jul 2024 23:54:55 +0100 Subject: [PATCH] imagery: update backend method --- cookbooks/imagery/recipes/tiler.rb | 1 + cookbooks/imagery/templates/default/nginx_titiler.conf.erb | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/cookbooks/imagery/recipes/tiler.rb b/cookbooks/imagery/recipes/tiler.rb index 1b86ef6f0..d56357d62 100644 --- a/cookbooks/imagery/recipes/tiler.rb +++ b/cookbooks/imagery/recipes/tiler.rb @@ -42,6 +42,7 @@ podman_service "titiler" do environment :BIND => "unix:/sockets/titiler.sock", :WORKERS_PER_CORE => 1, :GDAL_CACHEMAX => 200, + :GDAL_BAND_BLOCK_CACHE => "HASHSET", :GDAL_DISABLE_READDIR_ON_OPEN => "EMPTY_DIR", :GDAL_INGESTED_BYTES_AT_OPEN => 32768, :GDAL_HTTP_MERGE_CONSECUTIVE_RANGES => "YES", diff --git a/cookbooks/imagery/templates/default/nginx_titiler.conf.erb b/cookbooks/imagery/templates/default/nginx_titiler.conf.erb index 191ee495f..ea48a0cec 100644 --- a/cookbooks/imagery/templates/default/nginx_titiler.conf.erb +++ b/cookbooks/imagery/templates/default/nginx_titiler.conf.erb @@ -15,6 +15,10 @@ server { } } +upstream titiler_api_backend { + server unix:/srv/imagery/sockets/titiler.sock max_fails=0; +} + server { listen 443 ssl http2; listen [::]:443 ssl http2; @@ -46,7 +50,7 @@ server { location /api/v1/titiler { rewrite ^/api/v1/titiler(.*)$ $1 break; - proxy_pass unix:/srv/imagery/sockets/titiler.sock; + proxy_pass http://titiler_api_backend proxy_set_header Host $host; proxy_set_header Referer $http_referer; proxy_set_header X-Forwarded-For $remote_addr; -- 2.39.5