Welcome! Log In Create A New Profile

Advanced

Re: quick start on writing a module?

Maxim Dounin
June 16, 2010 11:34AM
Hello!

On Wed, Jun 16, 2010 at 05:13:40PM +0200, Piotr Sikora wrote:

> Hi,
> Maxim already answered most of your questions regarding writing a
> module like this from scratch. I would like to add that you can
> already do this, without writing new module, by misusing Maxim's
> excellent ngx_http_auth_request_module [1] and ngx_postgres [2].

I believe Valery Kholodkov's eval module
(http://grid.net.ru/nginx/eval.en.html) would fit better here than
auth request module.

> There are two "but":
> 1) Required "postgres_set" directive is still available only in my
> local repository. I intend to push it to GitHub today or tomorrow,
> after adding some test cases, so stay tuned :)

I believe this may be handled by eval as long as postgres module
is able to return something it understands.

> 2) You need to use "proxy_pass" for now. Ideally, you should create
> your own mini-module that would serve static files based on
> complex_value ($location). This should be mostly copy & paste of
> "ngx_http_static_handler" from nginx's ngx_http_static_module.c.

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

Also, with eval it's possible to use regular rewrites instead.

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: 147
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