This commit is contained in:
Zsolt Ero
2024-01-11 12:51:07 +01:00
parent 4709470025
commit f9431fb10d
3 changed files with 23 additions and 7 deletions

View File

@@ -69,9 +69,9 @@ def create_version_location(area: str, version: str, subdir: Path) -> str:
return f"""
location = /{area}/{version} {{ # no trailing slash
alias {tilejson_path}; # no trailing slash
default_type application/json;
expires 1d; # TODO target 1w
default_type application/json;
add_header 'Access-Control-Allow-Origin' '*' always;
add_header Cache-Control public;
@@ -79,11 +79,15 @@ def create_version_location(area: str, version: str, subdir: Path) -> str:
location /{area}/{version}/ {{ # trailing slash
alias {subdir}/tiles/; # trailing slash
try_files $uri @empty;
try_files $uri @empty_tile;
add_header Content-Encoding gzip;
expires 1d; # TODO target 10y
types {{
application/vnd.mapbox-vector-tile pbf;
}}
add_header 'Access-Control-Allow-Origin' '*' always;
add_header Cache-Control public;
}}
@@ -107,9 +111,9 @@ def create_latest_locations() -> str:
location_str += f"""
location = /{area} {{ # no trailing slash
alias {tilejson_path}; # no trailing slash
default_type application/json;
expires 1d;
default_type application/json;
add_header 'Access-Control-Allow-Origin' '*' always;
add_header Cache-Control public;