You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Commit a14be61 changed the way of checking subrequest from subrequest. This change of behaviour breaks fancyindex when the configuration issues a subrequest to fetch a template file in fancyindex_header subrequest.
The bug is reproducible with the latest version of njs.
I minimized the code and NGINX configuration to the smallest
possible to reproduce the issue.
This was originally reported (in Chinese) at tuna/mirror-web#452. I bisected the code and found the first breaking commit to be a14be61, which indeed is a modification to checking-related code.
2024/09/14 15:57:50 [error] 407026#0: *1 js exception: Error: subrequest can only be created for the primary request
at Request.subrequest (native)
at fancyIndexRender (fancy_index.njs:8)
at fancyIndexBeforeRender (fancy_index.njs:25)
, client: 127.0.0.1, server: localhost, request: "GET / HTTP/1.1", subrequest: "/fancy-index/before", host: "127.0.0.1:8000"
Output of the nginx -V command:
nginx version: nginx/1.27.1
built by gcc 12.2.0 (Debian 12.2.0-14)
built with OpenSSL 3.0.14 4 Jun 2024
TLS SNI support enabled
configure arguments: --prefix=/path/to/nginx_install --with-http_addition_module --add-dynamic-module=/path/to/njs/nginx --add-dynamic-module=/path/to/ngx-fancyindex
Exact steps to reproduce the behavior
Run NGINX with the configuration above, and access http://127.0.0.1:8000. Server will reply with 500 Internal Server Error with similar logs as provided.
Expected behavior
fancyindex should be able to fetch and render the template as before.
Describe the bug
Commit a14be61 changed the way of checking subrequest from subrequest. This change of behaviour breaks fancyindex when the configuration issues a subrequest to fetch a template file in
fancyindex_header
subrequest.possible to reproduce the issue.
This was originally reported (in Chinese) at tuna/mirror-web#452. I bisected the code and found the first breaking commit to be a14be61, which indeed is a modification to checking-related code.
To reproduce
Steps to reproduce the behavior:
/path/to/webroot/fancy_index.njs
touch /path/to/webroot/fancy-index/template.html
nginx -V
command:Run NGINX with the configuration above, and access
http://127.0.0.1:8000
. Server will reply with500 Internal Server Error
with similar logs as provided.Expected behavior
fancyindex should be able to fetch and render the template as before.
Your environment
The text was updated successfully, but these errors were encountered: