的/ etc/nginx的/啓用的站點 - /默認:的Lua Nginx的級聯錯誤
location /pine {
add_header Access-Control-Allow-Origin http://localhost:6285;
add_header Access-Control-Allow-Credentials true;
access_by_lua_file /home/akuznetsov/auth.lua;
proxy_pass http://localhost:9100;
}
auth.lua(1版,做工精細):
ngx.req.set_header('x-user-id', ngx.var.cookie_sessionid)
權威性。 lua(version 2,not working):
ngx.req.set_header('x-user-id', 'session:' .. ngx.var.cookie_sessionid)
在/var/log/nginx/error.log我得到這個錯誤:
2016/04/06 16:13:10 [error] 14183#0: *1 lua entry thread aborted: runtime error: /home/akuznetsov/auth.lua:2: attempt to concatenate field 'cookie_sessionid' (a nil value)
stack traceback:
coroutine 0:
/home/akuznetsov/auth.lua:2: in function </home/akuznetsov/auth.lua:1>, client: 127.0.0.1, server: localhost, request: "OPTIONS /pine HTTP/1.1", host: "localhost", referrer: "http://localhost:6285/chart/kjckCBcG/?pine=http://localhost/pine"
跆拳道? concat有什麼錯誤?
這不是一個調試服務...和WTF? concat有什麼錯誤?也不是一個合適的問題。請接受一些禮節。 – Piglet