Welcome! Log In Create A New Profile

Advanced

Re: HTTP Request filter module

agentzh
November 03, 2011 07:02AM
On Thu, Nov 3, 2011 at 3:06 PM, forum_id <nginx-forum@nginx.us> wrote:
>
> I have a requirement for HTTP request filter. Whenever I receive a HTTP
> request this filter module should read the request and does some
> internal statistical work, it doesn't manipulate the request page nor
> creates response page. It just need to peep into request that's it.
> After this filter module, nginx HTTP server should continue to process
> the request and serve the response to user. Can we do it without a proxy
> handler, because nginx serves the responses directly here.
>

I think this is a perfect use case for the rewrite_by_lua or
access_by_lua directives provided by the ngx_lua module. See

    http://wiki.nginx.org/HttpLuaModule

You can read and modify the request URI, query args, or even request
bodies in your Lua code and save the statistical results in the
shm-based dictionary (shared_dict) provided by ngx_lua or issue a
subrequest from within Lua to internal locations configured by
ngx_memc or ngx_redis2 via the ngx.location.capture API.

Because LuaJIT 2.0 is so light and so fast, this setting can achieve
performance comparable with an Nginx C module and also provide
scripting flexibility :)

Regards,
-agentzh

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

HTTP Request filter module

forum_id November 03, 2011 03:06AM

Re: HTTP Request filter module

Calin Don November 03, 2011 06:44AM

Re: HTTP Request filter module

forum_id November 03, 2011 08:12AM

Re: HTTP Request filter module

agentzh November 03, 2011 07:02AM

Re: HTTP Request filter module

forum_id November 03, 2011 08:13AM

Re: HTTP Request filter module

agentzh November 03, 2011 08:56AM

Re: HTTP Request filter module

forum_id November 04, 2011 06:50AM

Re: HTTP Request filter module

agentzh November 04, 2011 09:04AM

Re: HTTP Request filter module

forum_id November 04, 2011 10:11AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 83
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