X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/d22aedf599480f8603b6fc68d66337d0b6fbcd34..1bc8da5f3a3bfd6c3f0ba374f12d489d13831460:/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 cebf0efab..155620949 100644 --- a/cookbooks/imagery/templates/default/nginx_titiler.conf.erb +++ b/cookbooks/imagery/templates/default/nginx_titiler.conf.erb @@ -15,19 +15,19 @@ server { } } -upstream tiler_backend { - server 127.0.0.1:8080; - - keepalive 32; +upstream titiler_api_backend { + server unix:/srv/imagery/sockets/titiler.sock max_fails=0; + server unix:/srv/./imagery/sockets/titiler.sock max_fails=0; } -proxy_cache_path /var/cache/nginx-cache levels=1:2 keys_zone=ngi-aerial:64m; - 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 30s; + ssl_certificate /etc/ssl/certs/<%= @name %>.pem; ssl_certificate_key /etc/ssl/private/<%= @name %>.key; <% if node[:ssl][:strict_transport_security] -%> @@ -49,37 +49,19 @@ 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; proxy_set_header X-Forwarded-Proto https; proxy_set_header X-Forwarded-SSL on; proxy_http_version 1.1; + proxy_set_header Connection ""; proxy_redirect off; - } - location /ngi-aerial { - set $args ""; - rewrite ^/ngi-aerial/(\d+)/(\d+)/(\d+)\.jpg /mosaicjson/tiles/WebMercatorQuad/$1/$2/$3@1x?url=https%3A%2F%2Ftiler.openstreetmap.org%2Fza-25cm%2Fmosaic-tiler-https.json&pixel_selection=first&tile_format=jpeg break; - proxy_pass http://tiler_backend; - proxy_set_header Host $host; - proxy_set_header Referer $http_referer; - proxy_set_header X-Forwarded-For $remote_addr; - proxy_set_header X-Forwarded-Proto https; - proxy_set_header X-Forwarded-SSL on; - proxy_http_version 1.1; - proxy_redirect off; - proxy_cache_key "$scheme$proxy_host$uri"; - proxy_cache ngi-aerial; - proxy_cache_valid any 90d; - expires max; + allow 127.0.0.1; + deny all; } }