Skip to content

Not working with NGNIX #27

Open
Open
@edenisn

Description

@edenisn

I installed nginx-full and trying to use json.lua with NGINX:

Example:

nginx.conf:

location /test { default_type 'text/plain'; content_by_lua_block { local json = require("json") ngx.say(json.decode('[1,2,3,{"x":10}]')) }

then curl http://localhost:8080/test and got 500 error. But everything is ok in lua console:

`> json = require("json")

json.encode({ 1, 2, 3, { x = 10 } })
[1,2,3,{"x":10}]`

What I am doing wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions