trailing slash

This commit is contained in:
Zsolt Ero
2024-01-04 17:26:47 +01:00
parent 0aa9396088
commit 4b173ba50a
2 changed files with 8 additions and 8 deletions

View File

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

View File

@@ -26,8 +26,8 @@ server {
___LOCATION_BLOCKS___ ___LOCATION_BLOCKS___
location /fonts/ { location /fonts/ {
# trailing hash # trailing slash
alias /data/ofm/http_host/assets/fonts/; # trailing hash alias /data/ofm/http_host/assets/fonts/; # trailing slash
try_files $uri =404; try_files $uri =404;
default_type application/x-protobuf; default_type application/x-protobuf;