nginx-lua作者正在征集模块的使用场景,使得模块有机会进入trunk(nginx目前还是用SVN)
我很激动的写了一封邮件私下发了过去。开源项目用的人多说的少,最大原因是公司政策,特别大的公司用了也不好意思说。事实如此。 但开源是需要支持的,从用软件的那一刻起,就不是看客了。报bug,发pull request,重现bug,参与mailing list等。
尽管猜到很多人用,但微博上的回复还是令人鼓舞。下面的公司都在用:
taobao.com
56.com
qunar.com
Cisco webex
dbank.com
类似我这种私下的也会有吧,而且肯定有做CDN的人在用。从微博上的回复看,淘宝CDN开发了更多nginx模块,也表示会回馈社区的。
回看其他webserver,apache在最新的2.3版本中已经集成入lua:
Summary
This module allows the server to be extended with scripts written in the
Lua programming language.
The extension points (hooks) available with mod_lua include many of
the hooks available to natively compiled Apache HTTP Server modules,
such as mapping requests to files, generating dynamic responses,
access control, authentication, and authorization
apache社区的开发paul querna也对集成入lua有很高的期待:
While this example comes out signifigantly longer, I do believe in the
long run it will let people write more maintainable configurations,
espcially for things like complicated RewriteRules — since basic things
that have long be obsecured into RewriteCond can now be
easily accessed and evaluated with an If statement in Lua.
最后是我邮件的部分内容:
At first, we went with Netscaler. Though it is possible, the content
switching configuration is too complex and impossible to maintain. Then
we tried perl module comes with standard nginx distro. It works better
but not elegant, the perl script is scattered with random regex which is
hard to read. In the end, we rewrote all the logic using
nginx-lua.(rewrite_by_lua_file, content_by_lua_file).
In short, nginx and nginx-lua solve such task elegantly.
I think the best argument to integrate lua into nginx standard distro.
is every company has some complex logic to implement. These tasks can
not be solved by vanilla nginx even with the perl module. Then most
people don't known nginx core and not comfortable programming at C
level. Since reverse proxy like nginx set on the very front, there is
very high demand on its stability. This excludes casual C module for
nginx. Lua is a very approachable language for most people and it is
elegant.