Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Even if you don't intend to use build a complete web application using OpenResty, the underlying HttpLuaModule for nginx is awesome on its own if you're using nginx already. It makes it easy (among other things) to build logic around requests before they are handed off to a backend service. I used it for two different problems that would be more difficult to implement otherwise:

* Classifying incoming requests based on various signals to detect DDOS patterns and moving those requests into different request limit zones. It's used in production at a bigger hosting provider.

* Rewriting incoming requests to a certain path of an existing website to a different shared blog hosting provider and changing back HTML/CSS/JS so everything worked. It didn't end up going into production, but it was pretty easy to build in under 100 lines of Lua code.

So when you're bored and want to learn something useful, have a look at http://wiki.nginx.org/HttpLuaModule. It might help you someday.



"the underlying HttpLuaModule for nginx is awesome on its own if you're using nginx already"

This is the really important bit about OpenResty that sometimes gets overlooked, or buried under the "full-fledged web application server" motto. The "ngx_lua" module by itself basically nullifies the need for a bunch of other modules.

As anyone running nginx for something non-trivial can attest, adding modules can quickly become a support nightmare (varying levels of quality, issues you can't figure out if they're core or module related, keeping everything updated, confusing configurations, etc.).

Right now "ngx_lua" is one of my "must have" modules, together with "headers_more" and "set_misc" (which could also be replaced by "ngx_lua" rather easily, but with a slight impact in configuration readability).

I'd hope the nginx plus folks would rather make this official instead of going out with a competing module using JavaScript. Guess Lua is not hipster enough.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: