nginx alias with location regex get wrong file name

my location config:

location ~ ^/maat/(js|css|images)/ {
       alias /usr/local/services/gdt-frontend-test-1.0/maat/$1/;
       expires  1y;
    }

when i request http://xxxx/maat/js/entry_xxx.js
i got 301 with location: http://xxxx/maat/js/entry_xxx.js/

the debug log is this:

2021/02/22 10:57:14 (debug) 3423#0: *19 http header: "Host: audit2.test.qq.com"
2021/02/22 10:57:14 (debug) 3423#0: *19 http header: "Connection: keep-alive"
2021/02/22 10:57:14 (debug) 3423#0: *19 http header: "Accept-Encoding: gzip"
2021/02/22 10:57:14 (debug) 3423#0: *19 http header done
2021/02/22 10:57:14 (debug) 3423#0: *19 event timer del: 531: 28164571712
2021/02/22 10:57:14 (debug) 3423#0: *19 generic phase: 0
2021/02/22 10:57:14 (debug) 3423#0: *19 __mydebug_menshen. ngx_http_menshen_handler is 
called r: 00000000029F9630 nginx_version: 1016001
2021/02/22 10:57:14 (debug) 3423#0: *19 <1>status: MENSHEN_STATUS_CTX_CREATE_INIT. uri: 
/maat/js/entry_e731dc7.js. args:  r: 00000000029F9630 r->main: 00000000029F9630 r->count: 1
2021/02/22 10:57:14 (debug) 3423#0: *19 http cleanup add: 00000000029FA4E0
2021/02/22 10:57:14 (debug) 3423#0: *19 server menshen_module: -1 0000000002A56378
2021/02/22 10:57:14 (debug) 3423#0: *19 host and cgi not match ,ptr_conf_rule null
2021/02/22 10:57:14 (debug) 3423#0: *19 rewrite phase: 2
2021/02/22 10:57:14 (debug) 3423#0: *19 rewrite phase: 3
2021/02/22 10:57:14 (debug) 3423#0: *19 test location: "/maat/"
2021/02/22 10:57:14 (debug) 3423#0: *19 test location: "mo/"
2021/02/22 10:57:14 (debug) 3423#0: *19 test location: "logOut"
2021/02/22 10:57:14 (debug) 3423#0: *19 test location: "api/"
2021/02/22 10:57:14 (debug) 3423#0: *19 test location: ~ "^/maat/(js|css|images)/"
2021/02/22 10:57:14 (debug) 3423#0: *19 using configuration "^/maat/(js|css|images)/"
2021/02/22 10:57:14 (debug) 3423#0: *19 http cl:-1 max:8388608
2021/02/22 10:57:14 (debug) 3423#0: *19 rewrite phase: 5
2021/02/22 10:57:14 (debug) 3423#0: *19 rewrite phase: 6
2021/02/22 10:57:14 (debug) 3423#0: *19 post rewrite phase: 7
2021/02/22 10:57:14 (debug) 3423#0: *19 generic phase: 8
2021/02/22 10:57:14 (debug) 3423#0: *19 generic phase: 9
2021/02/22 10:57:14 (debug) 3423#0: *19 generic phase: 10
2021/02/22 10:57:14 (debug) 3423#0: *19 access phase: 11
2021/02/22 10:57:14 (debug) 3423#0: *19 access phase: 12
2021/02/22 10:57:14 (debug) 3423#0: *19 access phase: 13
2021/02/22 10:57:14 (debug) 3423#0: *19 post access phase: 14
2021/02/22 10:57:14 (debug) 3423#0: *19 generic phase: 15
2021/02/22 10:57:14 (debug) 3423#0: *19 generic phase: 16
2021/02/22 10:57:14 (debug) 3423#0: *19 content phase: 17
2021/02/22 10:57:14 (debug) 3423#0: *19 content phase: 18
2021/02/22 10:57:14 (debug) 3423#0: *19 content phase: 19
2021/02/22 10:57:14 (debug) 3423#0: *19 content phase: 20
2021/02/22 10:57:14 (debug) 3423#0: *19 content phase: 21
2021/02/22 10:57:14 (debug) 3423#0: *19 content phase: 22
2021/02/22 10:57:14 (debug) 3423#0: *19 http script copy: "/usr/local/services/gdt-frontend-test-1.0/maat/"
2021/02/22 10:57:14 (debug) 3423#0: *19 http script capture: "js"
2021/02/22 10:57:14 (debug) 3423#0: *19 http script copy: "/"
2021/02/22 10:57:14 (debug) 3423#0: *19 http filename: "/usr/local/services/gdt-frontend-test-1.0/maat/js/"
2021/02/22 10:57:14 (debug) 3423#0: *19 add cleanup: 00000000029FA550
2021/02/22 10:57:14 (debug) 3423#0: *19 http static fd: -1
2021/02/22 10:57:14 (debug) 3423#0: *19 http dir
2021/02/22 10:57:14 (debug) 3423#0: *19 http finalize request: 301, "/maat/js/entry_e731dc7.js?" a:1, c:1
2021/02/22 10:57:14 (debug) 3423#0: *19 http special response: 301, "/maat/js/entry_e731dc7.js?"
2021/02/22 10:57:14 (debug) 3423#0: *19 http set discard body
2021/02/22 10:57:14 (debug) 3423#0: *19 charset: "" > "utf-8"
2021/02/22 10:57:14 (debug) 3423#0: *19 HTTP/1.1 301 Moved Permanently
Server: nginx
Date: Mon, 22 Feb 2021 02:57:14 GMT
Content-Type: text/html
Content-Length: 162
Location: http://audit2.test.qq.com/maat/js/entry_e731dc7.js/
Connection: close
Expires: Tue, 22 Feb 2022 02:57:14 GMT
Cache-Control: max-age=31536000

2021/02/22 10:57:14 (debug) 3423#0: *19 write new buf t:1 f:0 0000000002B4F7D0, pos     0000000002B4F7D0, size: 287 file: 0, size: 0
2021/02/22 10:57:14 (debug) 3423#0: *19 http write filter: l:0 f:0 s:287
2021/02/22 10:57:14 (debug) 3423#0: *19 http output filter "/maat/js/entry_e731dc7.js?"
2021/02/22 10:57:14 (debug) 3423#0: *19 http copy filter: "/maat/js/entry_e731dc7.js?"
2021/02/22 10:57:14 (debug) 3423#0: *19 http postpone filter "/maat/js/entry_e731dc7.js?" 0000000002B4FA10
2021/02/22 10:57:14 (debug) 3423#0: *19 write old buf t:1 f:0 0000000002B4F7D0, pos     0000000002B4F7D0, size: 287 file: 0, size: 0
2021/02/22 10:57:14 (debug) 3423#0: *19 write new buf t:0 f:0 0000000000000000, pos 0000000000B97440, size: 116 file: 0, size: 0
2021/02/22 10:57:14 (debug) 3423#0: *19 write new buf t:0 f:0 0000000000000000, pos 0000000000B97200, size: 46 file: 0, size: 0
2021/02/22 10:57:14 (debug) 3423#0: *19 http write filter: l:1 f:0 s:449
2021/02/22 10:57:14 (debug) 3423#0: *19 http write filter limit 0
2021/02/22 10:57:14 (debug) 3423#0: *19 writev: 449 of 449
2021/02/22 10:57:14 (debug) 3423#0: *19 http write filter 0000000000000000
2021/02/22 10:57:14 (debug) 3423#0: *19 http copy filter: 0 "/maat/js/entry_e731dc7.js?"
2021/02/22 10:57:14 (debug) 3423#0: *19 http finalize request: 0, "/maat/js/entry_e731dc7.js?" a:1, c:1
2021/02/22 10:57:14 (debug) 3423#0: *19 http request count:1 blk:0
2021/02/22 10:57:14 (debug) 3423#0: *19 http close request
2021/02/22 10:57:14 (debug) 3423#0: *19 __mydebug. menshen cleanup r: 00000000029F9630
2021/02/22 10:57:14 (debug) 3423#0: *19 http log handler
2021/02/22 10:57:14 (debug) 3423#0: *19 http monitor handler
2021/02/22 10:57:14 (debug) 3423#0: *19 free: 00000000029F95E0, unused: 0
2021/02/22 10:57:14 (debug) 3423#0: *19 free: 0000000002B4F380, unused: 2096
2021/02/22 10:57:14 (debug) 3423#0: *19 close http connection: 531
2021/02/22 10:57:14 (debug) 3423#0: *19 reusable connection: 0
2021/02/22 10:57:14 (debug) 3423#0: *19 free: 0000000002B6F400
2021/02/22 10:57:14 (debug) 3423#0: *19 free: 0000000002C032C0, unused: 136
2021/02/22 10:57:14 (debug) 3429#0: *20 http header: "Host: audit2.test.qq.com"
2021/02/22 10:57:14 (debug) 3429#0: *20 http header: "Connection: keep-alive"
2021/02/22 10:57:14 (debug) 3429#0: *20 http header: "Accept-Encoding: gzip"
2021/02/22 10:57:14 (debug) 3429#0: *20 http header done
2021/02/22 10:57:14 (debug) 3429#0: *20 event timer del: 22: 28164571836
2021/02/22 10:57:14 (debug) 3429#0: *20 generic phase: 0
2021/02/22 10:57:14 (debug) 3429#0: *20 __mydebug_menshen. ngx_http_menshen_handler is called r: 00000000029F9630 nginx_version: 1016001
2021/02/22 10:57:14 (debug) 3429#0: *20 <1>status: MENSHEN_STATUS_CTX_CREATE_INIT. uri: /maat/js/entry_e731dc7.js/. args:  r: 00000000029F9630 r->main: 00000000029F9630 r->count: 1
2021/02/22 10:57:14 (debug) 3429#0: *20 http cleanup add: 00000000029FA4E0
2021/02/22 10:57:14 (debug) 3429#0: *20 server menshen_module: -1 0000000002A56378

why the http filename is the directory ?