Skip to content

Commit aa10dc9

Browse files
committed
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
1 parent 987fa42 commit aa10dc9

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

etc/rc.d/rc.nginx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ build_locations(){
412412
#
413413
# nchan subscriber endpoint
414414
#
415-
location ~ /sub/(.*)$ {
415+
location ~ ^/sub/(.*)$ {
416416
nchan_subscriber;
417417
nchan_subscriber_timeout 0;
418418
# nchan_authorize_request <url here>

0 commit comments

Comments
 (0)