quick start on writing a module?

Piotr Sikora piotr.sikora at frickle.com
Wed Jun 16 19:46:32 MSD 2010


Hi,

> I believe Valery Kholodkov's eval module
> (http://grid.net.ru/nginx/eval.en.html) would fit better here than
> auth request module.
> (..)
> I believe this may be handled by eval as long as postgres module
> is able to return something it understands.

I can't agree with you here. ngx_postgres can either return single value in 
clear text or whole result-set in RDS format (which can be converted to JSON 
using ngx_rds_json [1]). Since we need more than one value, we would need to 
either do multiple queries for each value or use JSON. Of course, we could 
extract values from JSON using ngx_lua [2], but this seems like quite an 
overhead for something that could be easily achieved by misusing your 
module.

> Something like alias /path/to/$location; should do the trick.

I tried that before suggesting "proxy_pass".

Unfortunately both "alias $location;" and "alias /$location;" results in 
"/etc/passwdindex.html" is not a directory while sending to client".

[1] http://github.com/agentzh/rds-json-nginx-module
[2] http://github.com/chaoslawful/lua-nginx-module

Best regards,
Piotr Sikora < piotr.sikora at frickle.com >
 




More information about the nginx mailing list