Welcome! Log In Create A New Profile

Advanced

Re: quick start on writing a module?

Maxim Dounin
June 16, 2010 12:32PM
Hello!

On Wed, Jun 16, 2010 at 05:46:32PM +0200, Piotr Sikora wrote:

> 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.

I wrote "as long as ..." on purpose, as I have no idea what
postrgess module is able to produce, sorry.

But as long as it's able to return single value in clear text it
should be possible to write select which will return all needed
data separated by newlines. This should be understood by eval
module easily.

> >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".

This is caused by index module and only applies when uri ends with
'/'. Workarounds are obvious, but I doubt they are actually
needed in this particular case.

Maxim Dounin

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

quick start on writing a module?

Mark Harrison June 16, 2010 05:34AM

Re: quick start on writing a module?

Maxim Dounin June 16, 2010 06:48AM

Re: quick start on writing a module?

Piotr Sikora June 16, 2010 11:20AM

Re: quick start on writing a module?

Maxim Dounin June 16, 2010 11:34AM

Re: quick start on writing a module?

Piotr Sikora June 16, 2010 11:54AM

Re: quick start on writing a module?

Maxim Dounin June 16, 2010 12:32PM

Re: quick start on writing a module?

Piotr Sikora June 16, 2010 12:52PM

Re: quick start on writing a module?

Maxim Dounin June 16, 2010 01:32PM

Re: quick start on writing a module?

Piotr Sikora June 16, 2010 01:52PM

Re: quick start on writing a module?

Piotr Sikora June 16, 2010 01:48PM

Re: quick start on writing a module?

agentzh June 16, 2010 10:18PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 170
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready