From 1faaa6e7b48feeda1e7e84f040e3b3acd19e2ce0 Mon Sep 17 00:00:00 2001 From: gluap Date: Sun, 16 Jul 2023 13:09:26 +0200 Subject: [PATCH] nginx config example to cache tiles up to level 12 for a day. --- deployment/config/nginx.conf | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 deployment/config/nginx.conf diff --git a/deployment/config/nginx.conf b/deployment/config/nginx.conf new file mode 100644 index 0000000..b4f7555 --- /dev/null +++ b/deployment/config/nginx.conf @@ -0,0 +1,22 @@ + +events {} +http { + proxy_cache_path /data/nginx/cache levels=1:2 keys_zone=STATIC:10m + inactive=24h max_size=1g; + server { + location ~* ^/tiles/\d[012]?/[^?]+$ { + proxy_pass http://portal:3000; + proxy_set_header Host $host:3000; + proxy_buffering on; + proxy_cache_methods GET HEAD; + proxy_cache STATIC; + proxy_cache_valid 200 1d; + proxy_cache_use_stale error timeout invalid_header updating + http_500 http_502 http_503 http_504; + } + location / { + proxy_pass http://portal:3000; + proxy_set_header Host $host:3000; + } + } +}