We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
For the below nginx.conf, path /a, /c and /e gives expected output 403 forbidden.
But for path /b and /d, the first invocation gives 500 internal server error. Invoking the same path again in future gives 404 not found.
nginx.conf
worker_processes 1; error_log logs/error.log notice; daemon off; events { worker_connections 1024; } http { server { listen 8888; location /a { access_by_lua_block { return ngx.exit(ngx.HTTP_FORBIDDEN) } } # 500, then 404 location /b { access_by_lua_block { require('access') } } location /c { access_by_lua "return ngx.exit(ngx.HTTP_FORBIDDEN)"; } # 500, then 404 location /d { access_by_lua "require('access')"; } location /e { access_by_lua_file "access.lua"; } } }
access.lua
return ngx.exit(ngx.HTTP_FORBIDDEN)
Here is the partial error.log after invoking path /b
[error] 9657#100092: *1 lua entry thread aborted: runtime error: attempt to yield across C-call boundary stack traceback: coroutine 0: [C]: in function 'require' access_by_lua(nginx.conf:22):2: in main chunk, client: 192.168.50.96, server: , request: "GET /b HTTP/1.1", host: "192.168.50.124:8888" [error] 9657#100092: *2 open() "./html/b" failed (2: No such file or directory), client: 192.168.50.96, server: , request: "GET /b HTTP/1.1", host: "192.168.50.124:8888"
OpenResty 1.19.3.1 on Windows and FreeBSD
The text was updated successfully, but these errors were encountered:
see openresty/lua-resty-redis#3 ,this is a limit of require function
require
Sorry, something went wrong.
No branches or pull requests
For the below nginx.conf, path /a, /c and /e gives expected output 403 forbidden.
But for path /b and /d, the first invocation gives 500 internal server error. Invoking the same path again in future gives 404 not found.
nginx.conf
access.lua
Here is the partial error.log after invoking path /b
OpenResty 1.19.3.1 on Windows and FreeBSD
The text was updated successfully, but these errors were encountered: