From 58af39e6196f42e73037da4255fe7d3775eccaa0 Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Sun, 29 Sep 2019 16:51:52 +0200 Subject: [PATCH] small vhost adjustments --- CHANGELOG.md | 2 +- overlay/etc/nginx/vhost.conf | 25 +++++++++++++------------ 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 84a59ad..72acd59 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,3 @@ * BUGFIX * fix port in healthcheck script - * use a more strict vhost + * small vhost adjustments diff --git a/overlay/etc/nginx/vhost.conf b/overlay/etc/nginx/vhost.conf index df9e964..b001329 100644 --- a/overlay/etc/nginx/vhost.conf +++ b/overlay/etc/nginx/vhost.conf @@ -9,20 +9,13 @@ server { try_files $uri $uri/ /index.php$is_args$args; } - location ~ /plugins/.*/Assets/ { - allow all; + error_page 404 = @notfound; + + location @notfound { + return 301 /; } - location ~ /(app|data|libs|plugins|vendor|cli) { - deny all; - return 404; - } - - location ~* ^.+\.(log|sqlite)$ { - return 404; - } - - location ~ /\.ht { + location ~ /(cli|data) { return 404; } @@ -35,6 +28,14 @@ server { include fastcgi_params; } + location ~* ^.+\.(log|sqlite)$ { + return 404; + } + + location ~ /\.ht { + return 404; + } + location ~* ^.+\.(ico|jpg|gif|png|css|js|svg|eot|ttf|woff|woff2|otf)$ { log_not_found off; expires 7d;