From aa10dc937c5d688befd5fda41f6d0c2c7546c5d7 Mon Sep 17 00:00:00 2001 From: mgutt <10757176+mgutt@users.noreply.github.com> Date: Sat, 27 Dec 2025 13:31:46 +0100 Subject: [PATCH] Fix nchan regex to prevent intercepting /sub/ in file paths The regex pattern '~ /sub/(.*)$' matched /sub/ anywhere in the path, including file paths like /mnt/disk2/test/foo/sub/file.iso. This caused nginx to route these requests to the nchan subscriber endpoint instead of serving the files. Changed to '~ ^/sub/(.*)$' to only match paths that start with /sub/, which is the correct behavior for the nchan websocket endpoint. Fixes #2493 --- etc/rc.d/rc.nginx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/rc.d/rc.nginx b/etc/rc.d/rc.nginx index c8e71ba764..88e1bfa344 100755 --- a/etc/rc.d/rc.nginx +++ b/etc/rc.d/rc.nginx @@ -412,7 +412,7 @@ build_locations(){ # # nchan subscriber endpoint # - location ~ /sub/(.*)$ { + location ~ ^/sub/(.*)$ { nchan_subscriber; nchan_subscriber_timeout 0; # nchan_authorize_request