From af3338fc80c1ba377320a819e20d20c8460b280d Mon Sep 17 00:00:00 2001 From: Zsolt Ero Date: Fri, 29 Dec 2023 04:02:58 +0100 Subject: [PATCH] nginx --- scripts/http_host/nginx_sync/nginx_sync.py | 8 +++++--- ssh_lib/assets/nginx/nginx.conf | 4 +++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/scripts/http_host/nginx_sync/nginx_sync.py b/scripts/http_host/nginx_sync/nginx_sync.py index d063826..b6cf9be 100755 --- a/scripts/http_host/nginx_sync/nginx_sync.py +++ b/scripts/http_host/nginx_sync/nginx_sync.py @@ -31,9 +31,11 @@ def cli(): area, version = subdir.name.split('-') version_str = rf""" - location /{area}/{version}/ {{ - alias {subdir}; + location /{area}/{version}/ {{ # trailing hash important + alias {subdir}/; # trailing hash important try_files $uri @empty; + + autoindex on; }} """ @@ -52,7 +54,7 @@ def cli(): print('nginx config written') subprocess.run(['nginx', '-t'], check=True) - subprocess.run(['service', 'nginx', 'reload'], check=True) + subprocess.run(['systemctl', 'reload', 'nginx'], check=True) print(help_text) diff --git a/ssh_lib/assets/nginx/nginx.conf b/ssh_lib/assets/nginx/nginx.conf index 08fdc4a..e438098 100644 --- a/ssh_lib/assets/nginx/nginx.conf +++ b/ssh_lib/assets/nginx/nginx.conf @@ -21,8 +21,10 @@ http { server_tokens off; - # TODO add application/vnd.mapbox-vector-tile include /etc/nginx/mime.types; + types { + application/vnd.mapbox-vector-tile pbf; + } default_type application/octet-stream; charset utf-8;