From bad3a1ccadd86529fe5e1ff8d7f8648907d576cb Mon Sep 17 00:00:00 2001 From: Tobias <96661824+CrazyWolf13@users.noreply.github.com> Date: Mon, 22 Dec 2025 14:02:37 +0100 Subject: [PATCH] refactor --- ct/reitti.sh | 59 +++++++++++++--------------------------------------- 1 file changed, 14 insertions(+), 45 deletions(-) diff --git a/ct/reitti.sh b/ct/reitti.sh index 83897a83f..4e5d63b78 100644 --- a/ct/reitti.sh +++ b/ct/reitti.sh @@ -32,57 +32,26 @@ function update_script() { msg_info "Installing Nginx Tile Cache" mkdir -p /var/cache/nginx/tiles $STD apt install -y nginx - cat >> /etc/nginx/nginx.conf << 'EOF' -user www-data; -worker_processes auto; -pid /run/nginx.pid; -include /usr/share/nginx/modules/*.conf; - + cat </etc/nginx/nginx.conf events { - worker_connections 1024; + worker_connections 1024; } - http { - ## - # Basic defaults - ## - include /etc/nginx/mime.types; - default_type application/octet-stream; - - sendfile on; - keepalive_timeout 65; - types_hash_max_size 4096; - - ## - # Logging - ## - access_log /var/log/nginx/access.log; - error_log /var/log/nginx/error.log; - - ## - # Proxy cache for tiles - ## - proxy_cache_path /var/cache/nginx/tiles levels=1:2 keys_zone=tiles:10m max_size=1g inactive=30d use_temp_path=off; - - server { - listen 80; - - location / { - proxy_pass https://tile.openstreetmap.org/; - proxy_set_header Host tile.openstreetmap.org; - proxy_set_header User-Agent "Reitti/1.0"; - proxy_cache tiles; - proxy_cache_valid 200 30d; - proxy_cache_use_stale error timeout updating http_500 http_502 http_503 http_504; - } + proxy_cache_path /var/cache/nginx/tiles levels=1:2 keys_zone=tiles:10m max_size=1g inactive=30d use_temp_path=off; + server { + listen 80; + location / { + proxy_pass https://tile.openstreetmap.org/; + proxy_set_header Host tile.openstreetmap.org; + proxy_set_header User-Agent "Reitti/1.0"; + proxy_cache tiles; + proxy_cache_valid 200 30d; + proxy_cache_use_stale error timeout updating http_500 http_502 http_503 http_504; } - - ## - # Load additional configs - ## - include /etc/nginx/conf.d/*.conf; + } } EOF + chown -R www-data:www-data /var/cache/nginx/tiles systemctl restart nginx echo "reitti.ui.tiles.cache.url=http://127.0.0.1" >> /opt/reitti/application.properties systemctl restart reitti