From 8232b519397f106d694bfdb2eeecb2f4cb405475 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20Jos=C3=A9=20Pereira?= Date: Tue, 28 Apr 2026 07:16:20 -0300 Subject: [PATCH] core: tools: nginx: Add a 404 if extension is not registered MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Patrick José Pereira --- core/tools/nginx/nginx.conf | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/core/tools/nginx/nginx.conf b/core/tools/nginx/nginx.conf index 3b52f013ca..278c31849e 100644 --- a/core/tools/nginx/nginx.conf +++ b/core/tools/nginx/nginx.conf @@ -313,6 +313,19 @@ http { location ~ ^/redirect-port/(?\d+) { return 301 $scheme://$host:$port; } + + # Catch-all for unknown extensions: returns a real 404 instead of + # falling through to the Vue SPA. + location ^~ /extensionv2/ { + error_page 404 = @extension_not_found; + return 404; + } + + location @extension_not_found { + default_type application/json; + return 404 '{"error":"extension_not_found","message":"No registered extension matches this URL, the extension might not be running or installed."}'; + } + include /home/pi/tools/nginx/extensions/*.conf; } }