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
When the rewrite_by_lua_file line is commented out, I can access content in /protected, as expected. When not commented out, access to /protected/index.html leads to a Lua runtime error:
2023/05/30 09:15:43 [error] 18532#18532: *17 lua entry thread aborted: runtime error: /usr/local/openresty/nginx/scripts/htaccess.lua:119: attempt to concatenate global 'doc_root' (a nil value)
stack traceback:
coroutine 0:
/usr/local/openresty/nginx/scripts/htaccess.lua: in function 'ensure_doc_root'
/usr/local/openresty/nginx/scripts/htaccess.lua:145: in function 'get_file_contents'
/usr/local/openresty/nginx/scripts/htaccess.lua:507: in function 'parse_htaccess_directive'
/usr/local/openresty/nginx/scripts/htaccess.lua:1012: in main chunk, client: 146.90.194.232, server: foo.bar.com, request: "GET /protected/index.html HTTP/2.0", host: "foo.bar.com"
Any idea what could be the cause of the problem? It seems like in
I'm getting an error using
htaccess.lua
withopenresty/1.21.4.1
under the following circumstances:I'm using the latest
htaccess.lua
from this repository. I've placed it in/usr/local/openresty/nginx/scripts
.I have a directory,
/usr/local/openresty/nginx/html/protected
, which I'm trying to protect using.htaccess
.The
.htaccess
file (/usr/local/openresty/nginx/html/protected/.htaccess
) contents are:When the
rewrite_by_lua_file
line is commented out, I can access content in/protected
, as expected. When not commented out, access to/protected/index.html
leads to a Lua runtime error:Any idea what could be the cause of the problem? It seems like in
htaccess-for-nginx/htaccess.lua
Lines 114 to 118 in b81c1f1
there's a reference to
doc_root
, which is not defined globally and is local toin_doc_root
.The text was updated successfully, but these errors were encountered: