openresty / openresty/lua-nginx-module

attempt to call field 'exit' (a nil value)

Open
#1,989 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
11.8k
Forks
2.1k
Avg merge
6h 1m
Merged PRs (30d)
6

Description

CentOS Linux release 7.9.2009 (Core)
lua-nginx-module-0.10.20

luajit -v
LuaJIT 2.1.0-beta3 -- Copyright (C) 2005-2021 Mike Pall. https://luajit.org/

nginx -V
nginx version: nginx/1.19.3
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC) 
built with OpenSSL 1.1.1g  21 Apr 2020
TLS SNI support enabled
configure arguments: --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_v2_module --with-http_gzip_static_module --with-http_sub_module --with-stream --with-stream_ssl_module --with-openssl=/data/install/lnmp1.7/src/openssl-1.1.1g --with-openssl-opt=enable-weak-ssl-ciphers --add-dynamic-module=/usr/local/nginx/module/headers-more-nginx-module --add-dynamic-module=/home/jsx/lua-nginx-module-0.10.20 --add-dynamic-module=/home/jsx/redis2-nginx-module-0.15/ --add-dynamic-module=/home/jsx/echo-nginx-module-0.62/

demo.com.conf

    # ...
    location / {
        access_by_lua_file /usr/local/nginx/conf/lua/ip.lua;
        try_files $uri $uri/ /index.php?$query_string;
    }
   # ...

/usr/local/nginx/conf/lua/ip.lua

ngx.status = ngx.HTTP_GONE
ngx.say("This is our own content")
return ngx.exit(ngx.HTTP_GONE)

error.log

2022/01/10 16:07:50 [error] 28446#0: *60 lua entry thread aborted: runtime error: /usr/local/nginx/conf/lua/ip.lua:3: attempt to call field 'exit' (a nil value)
stack traceback:
coroutine 0:
	/usr/local/nginx/conf/lua/ip.lua: in function </usr/local/nginx/conf/lua/ip.lua:1>, client: 10.18.68.142, server: demo.com, request: "GET / HTTP/1.1", host: "demo.com"

What's going on here

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with /usr/local/nginx/conf/lua/ip.lua and the location using access_by_lua_file, then compare the reported lua-nginx-module 0.10.20 and nginx configuration with the module's documented API. Done means explaining why ngx.exit is nil in this setup and identifying the relevant configuration or compatibility issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua, nginx
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.