TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Nginx and Lua

61 pointsby transmit101over 12 years ago

7 comments

Lasherover 12 years ago
Different application area but we implemented Lua into a MUD (online RPG) as the scripting interface for all area builder development and it was probably the single most valuable change we ever made. Check out the 'lua coding' section on Aardwolf.com if you want to see some examples. Over 200,000 lines of lua now, millions of prog executions per hour and still as fast as ever.
评论 #4465641 未加载
jotover 12 years ago
Can you provide us with an idea of how much this improved performance or how many more requests it allowed you to handle? Were there time or cost savings compared to alternative approaches?
评论 #4463860 未加载
评论 #4463992 未加载
slurgfestover 12 years ago
Is there any reason in principle why this has to be done with Lua and not with other interpreted languages?<p>Once you are writing interpreted code which reads request data and interacts with Redis you are not that far from what a normal Ruby or Python web app does anyway.
评论 #4464262 未加载
评论 #4464256 未加载
评论 #4464361 未加载
justincormackover 12 years ago
There is an introductory talk (video and slides) from the London Lua meetup group on Nginx and Lua here <a href="http://www.londonlua.org/scripting_nginx_with_lua/index.html" rel="nofollow">http://www.londonlua.org/scripting_nginx_with_lua/index.html</a>
评论 #4464505 未加载
kyrraover 12 years ago
So the idea is interesting, but I think adding something like this onto Nginx could lead to problems in the future.<p>For what you're trying to do, I feel like implementing your reverse proxy in Go may prove to be less prone to errors. Go has ReverseProxy stuff already built in: <a href="http://golang.org/pkg/net/http/httputil/#ReverseProxy" rel="nofollow">http://golang.org/pkg/net/http/httputil/#ReverseProxy</a><p>Go already has a pretty strong following doing near exactly what you are doing here with Nginx + Lua. But that would require learning a new language and screwing with infrastructure, which always is a giant pain.
评论 #4465532 未加载
评论 #4464341 未加载
评论 #4464352 未加载
rotation1over 12 years ago
Bit off topic but you might want to 301 redirect to the right page instead of just disallowing search engines on your subdomains. This way if someone links to the wrong page you will still get the link juice.<p>I might have misunderstood that first bit though, since it looks like you do redirect anyway.
评论 #4464663 未加载
sciurusover 12 years ago
It's nice to see how tight the lua integration into nginx is. It reminds me of Apache and mod_perl.