On Sat, Nov 27, 2010 at 8:06 PM, Delta Yeh <delta.yeh@gmail.com> wrote:
> can lua be introduced into ngx_proxy_more, so there can what we can with lua
> when proxy a request?
>
The standard ngx_proxy module can already be used together with
ngx_lua, so will ngx_proxy_more :)
Actually any nginx modules can be used with ngx_lua.
There's mainly 5 ways:
1. Use set_by_lua at rewrite phase, and use other content handler
modules like ngx_proxy and ngx_fastcgi.
2. Use content_by_lua as the content handler to generate contents, and
use output filter modules, like ngx_headers and ngx_ctpp2 to process
the outputs later.
3. Use the ngx.location.capture() call from within Lua code to make
nginx subrequests to other nginx locations configured by ngx_drizzle,
ngx_postgres, ngx_proxy, and any other content handler modules.
4. Use the ngx.exec() call from within Lua (content_by_lua) to make
internal redirection to other locations. (Remember, it's not a
subrequest, rather, a "goto", which never comes back.)
5. Invoke other nginx module's config directives' computation at
runtime directly from within Lua by means of the ndk.set_var.DIRECTIVE
call. Configure directives used this way are limited to those
implemented atop NDK's set_var submodules' ndk_set_var_value
interface.
Please check out the ngx_lua documentation for more details:
https://github.com/chaoslawful/lua-nginx-module/
Our focus has been on making ngx_lua and the Lua programming language
the right glue in the whole nginx ecosystem, and helping Lua replace
PHP in more and more web applications that require outstanding
performance.
Cheers,
-agentzh
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://nginx.org/mailman/listinfo/nginx-devel