Generating the domain inside the style JSON files dynamically (using nginx sub_filter).

This commit is contained in:
Zsolt Ero
2024-10-24 01:29:12 +02:00
parent 2bee8df5fe
commit 717a197ba8
3 changed files with 18 additions and 0 deletions

View File

@@ -46,6 +46,11 @@ server {
expires 1d;
default_type application/json;
# substitute the domain in the TileJSON
sub_filter '__TILEJSON_DOMAIN__' '__DOMAIN__';
sub_filter_once off;
sub_filter_types '*';
add_header 'Access-Control-Allow-Origin' '*' always;
add_header Cache-Control public;
}

View File

@@ -40,6 +40,11 @@ server {
expires 1d;
default_type application/json;
# substitute the domain in the TileJSON
sub_filter '__TILEJSON_DOMAIN__' '__DOMAIN__';
sub_filter_once off;
sub_filter_types '*';
add_header 'Access-Control-Allow-Origin' '*' always;
add_header Cache-Control public;
}