openresty / openresty/lua-nginx-module
content_by_lua_block ignored if fastcgi_pass statement is used
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 11.8k
- Forks
- 2.1k
- Avg merge
- 6h 1m
- Merged PRs (30d)
- 6
Description
Hello,
Lua is not invoked when fastcgi_pass is used.
location / {
content_by_lua_block {
ngx.log(ngx.ERR, "HELLO")
ngx.exit(ngx.HTTP_FORBIDDEN)
}
fastcgi_pass unix:/dev/shm/master/fcgiwrap.socket;
}
Commenting the 'fastcgi_pass' line and it all works as expected (I see "HELLO" in the logs). But with fastcgi_pass statement the lua-block is not evaluated at all. In fact it's possible to have illegal LUA statements inside the lua_block and nginx wont even complain about them being illegal.
I came to this while trying to process some FORM POST data before passing them on via fastcgi_pass.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the shown location configuration with content_by_lua_block and fastcgi_pass, then trace the module entry points handling those directives. Confirm whether the Lua block is skipped during FastCGI processing; done means valid Lua is evaluated and can log or reject the request before FastCGI handling.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua, nginx
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100