nginx work

This commit is contained in:
Zsolt Ero
2024-01-04 02:44:49 +01:00
parent b3ce2bd9dd
commit 0aa9396088
4 changed files with 34 additions and 13 deletions

View File

@@ -66,25 +66,24 @@ def create_version_location(area: str, version: str, subdir: Path) -> str:
check=True,
)
# TODO # target 10y
return f"""
location /{area}/{version} {{ # no trailing hash
alias {tilejson_path}; # no trailing hash
location = /{area}/{version} {{ # no trailing hash
alias {tilejson_path}; # no trailing hash
default_type application/json;
add_header 'Access-Control-Allow-Origin' '*' always;
add_header Cache-Control public;
expires 1d;
expires 1d; # TODO target 1w
}}
location /{area}/{version}/ {{ # trailing hash
alias {subdir}/tiles/; # trailing hash
location /{area}/{version}/ {{ # trailing hash
alias {subdir}/tiles/; # trailing hash
try_files $uri @empty;
add_header Content-Encoding gzip;
add_header 'Access-Control-Allow-Origin' '*' always;
add_header Cache-Control public;
expires 1d; # target 10y
expires 1d; # TODO target 10y
}}
"""
@@ -104,7 +103,7 @@ def create_latest_locations() -> str:
assert tilejson_path.exists()
location_str += f"""
location /{area} {{ # no trailing hash
location = /{area} {{ # no trailing hash
alias {tilejson_path}; # no trailing hash
default_type application/json;