Hello!
On Tue, Dec 17, 2013 at 2:49 PM, babak houman wrote:
> We have already tried several approaches to create a web-app automatically
> out of a given description. This includes a PHP based webapp and a Node.js
> based.
This project sounds fun :)
> In the latter case I am a little bit concerned about the scalibility and
> stability of the utilities we use. So I decided to look around and found
> your project which is a perfekt introduction to using
> nginx.
You're very welcome to add support for OpenResty/ngx_lua based
backends :) You should observe much better performance than PHP and
Node.js.
> I managed to generate an json rest api to the database functionality only
> using your very appreciated work OpenResty and the detailed introduction.
> Is it possible to use only OpenResty (nginx and modules) to achive the
> follwoing goal:
> . create a session in the nginx context (without using any additional
> scripting php/lua)
See https://github.com/agentzh/encrypted-session-nginx-module
But given that ngx_lua and your Lua code is running directly within
the Nginx server, it's fine to do this in Lua as well.
> . check the existence of a valid session for the given user before execution
> of the query
>
You can do this by pure nginx.conf scripting, but use of Lua in your
nginx server is recommended.
> So far I was able to autheticate a user against the postgres stored
> procedure "autheticate"
Yes, you can use the ngx_encrypted_session module with the ngx_postgres module.
When I was working on the nginx-based web service APIs for the
lz.taobao.com site a few years ago I also tried to use pure nginx.conf
scripting for complicated things. But quickly I found it really hard
to maintain and debug. That's why we created the ngx_lua module to
embed the Lua/LuaJIT engine into the nginx core. Since then the world
is clean and fast.
Regards,
-agentzh