]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/imagery/templates/default/nginx_titiler.conf.erb
Merge remote-tracking branch 'github/pull/713'
[chef.git] / cookbooks / imagery / templates / default / nginx_titiler.conf.erb
index 20ed10bc1fbd1e8e6934212e4728377d0e4d0749..155620949e425fe688692b5ee2a50a5c897e5c82 100644 (file)
@@ -15,6 +15,11 @@ 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;
@@ -46,7 +51,7 @@ server {
 
     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;
@@ -55,5 +60,8 @@ server {
       proxy_http_version 1.1;
       proxy_set_header Connection "";
       proxy_redirect off;
+
+      allow 127.0.0.1;
+      deny all;
     }
 }