content_by_lua_file should not return 404 if file permission denied

69 views
Skip to first unread message

Zhuozhi Ji

unread,
Jan 15, 2022, 11:10:21 AM1/15/22
to openresty-en

There are three situations in opening a file in the Linux file system

  1. Open successfully and execute
  2. The file exists but has no permissions
  3. The file does not exist

In some cases, developers may set wrong permissions when deploying lua scripts. At this time, content_by_lua_file will directly return 404, which is inappropriate. It stands to reason that it should return 403 or other 5xx series exception codes. , which makes it easier for us to use other anomaly detection systems to identify anomalies.

I also created a GitHub issue to trace this problem https://github.com/openresty/lua-nginx-module/issues/1992

Reply all
Reply to author
Forward
0 new messages