X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/4e3d38f80c67c7746bdc8113c966e5ac12f1ffa0..5140825588fff4606e47260b6e1d64973474317a:/cookbooks/imagery/templates/default/nginx_titiler.conf.erb diff --git a/cookbooks/imagery/templates/default/nginx_titiler.conf.erb b/cookbooks/imagery/templates/default/nginx_titiler.conf.erb index a1dbb9377..155620949 100644 --- a/cookbooks/imagery/templates/default/nginx_titiler.conf.erb +++ b/cookbooks/imagery/templates/default/nginx_titiler.conf.erb @@ -15,13 +15,18 @@ server { } } +upstream titiler_api_backend { + server unix:/srv/imagery/sockets/titiler.sock max_fails=0; + server unix:/srv/./imagery/sockets/titiler.sock max_fails=0; +} + server { listen 443 ssl http2; listen [::]:443 ssl http2; server_name <%= @name %> <% @aliases.each do |alias_name| %> <%= alias_name %><%- end -%>; http2_max_concurrent_streams 512; - keepalive_timeout 10s; + keepalive_timeout 30s; ssl_certificate /etc/ssl/certs/<%= @name %>.pem; ssl_certificate_key /etc/ssl/private/<%= @name %>.key; @@ -44,14 +49,9 @@ server { gzip_comp_level 9; gzip_vary on; - location /za-25cm { - root "/store/imagery/za"; - expires max; - } - location /api/v1/titiler { rewrite ^/api/v1/titiler(.*)$ $1 break; - proxy_pass http://localhost:8080; + 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; @@ -60,5 +60,8 @@ server { proxy_http_version 1.1; proxy_set_header Connection ""; proxy_redirect off; + + allow 127.0.0.1; + deny all; } }