HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
openresty
lua-nginx-module
C2010–2024
openresty / lua-nginx-module

lua-nginx-module

Embed the Power of Lua into NGINX HTTP servers

26Distinct people
29Mentions
0Explicit recommenders
11.8KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

Embed the Power of Lua into NGINX HTTP servers

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 12:54:37 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year29 dated mentions

Observed mentions: 2010-08-17 02:20:13 UTC to 2024-03-19 00:17:28 UTC.

012342010-01-01 00:00:00 UTC to 2011-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments20102011-01-01 00:00:00 UTC to 2012-01-01 00:00:00 UTC (exclusive): 4 mentions; 0 submissions, 4 comments2012-01-01 00:00:00 UTC to 2013-01-01 00:00:00 UTC (exclusive): 3 mentions; 0 submissions, 3 comments2013-01-01 00:00:00 UTC to 2014-01-01 00:00:00 UTC (exclusive): 4 mentions; 0 submissions, 4 comments2014-01-01 00:00:00 UTC to 2015-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2015-01-01 00:00:00 UTC to 2016-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2016-01-01 00:00:00 UTC to 2017-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 3 mentions; 0 submissions, 3 comments20172018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2024

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20102010-01-01 00:00:00 UTC2011-01-01 00:00:00 UTC101
20112011-01-01 00:00:00 UTC2012-01-01 00:00:00 UTC404
20122012-01-01 00:00:00 UTC2013-01-01 00:00:00 UTC303
20132013-01-01 00:00:00 UTC2014-01-01 00:00:00 UTC404
20142014-01-01 00:00:00 UTC2015-01-01 00:00:00 UTC101
20152015-01-01 00:00:00 UTC2016-01-01 00:00:00 UTC101
20162016-01-01 00:00:00 UTC2017-01-01 00:00:00 UTC101
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC303
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC202
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC101
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC202
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC202
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC101
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC202
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC101

What Hacker News says

29 sources
"small embeddable dynamic languages" are usually used to configure or program other larger compiled applications. This is bes understood by example: https://create.roblox.com/docs/tutorials/scripting/basic-scr... - make a mini game in Roblox https://github.com/openresty/lua-nginx-module?tab=readme-ov-... - configure and extend NGINX https://wezfurlong.org/wezterm/config/lua/general.html - make your terminal more useful (my personal config changes the tab color based on the process name - https://github.com/bbkane/dotfiles/blob/master/wezterm/dot-c... https://m.youtube.com/watch?v=MQBr9hwf0BY - configure your text editor
In Ravi is a dialect of Lua, with JIT and AOT compilers
Here's an example of how I'm using it. Basically to log part of the response body to API requests. log_format main '$remote_addr - - [$time_local] "$request" ' '$status $body_bytes_sent "$host" ' '"$http_user_agent" $http_content_length $request_time ' '"$resp_body" *$connection $connection_requests'; server { set $resp_body ""; location ~ "^/api/v1/...$" { # Append response to resp_body until it reaches max_len. # - ngx.arg[1] is input chunk. # - ngx.arg[2] is eof flag (response is done). # - ngx.ctx.resp_body holds partial result between calls # - ngx.var.resp_body holds final result. # From: # - https://gist.github.com/morhekil/1ff0e902ed4de2adcb7a #
Read the rest
- https://github.com/openresty/lua-nginx-module/ body_filter_by_lua_block { local max_len = 256 local resp_body = (ngx.ctx.resp_body or "") if string.len(resp_body) <= max_len then resp_body = resp_body .. string.sub(ngx.arg[1], 1, max_len) ngx.ctx.resp_body = string.sub(resp_body, 1, max_len) end if ngx.arg[2] then ngx.var.resp_body = ngx.ctx.resp_body end } } But there are many scenarios where being able to extend the HTTP server via Lua is more convenient than writing a plugin I would think? I've also used Lua in the past with haproxy and with Redis. It's a powerful, performant, light-weight, and flexible escape hatch/extension mechanism.
In The future of Nginx: Getting back to our open source roots
Do you mean with respect to balancing when endpoints come/go (e.g. a POD goes up/down)? Or something else? In this case, it depends on the ingress controller used. The default nginx ingress case has some docs: https://kubernetes.github.io/ingress-nginx/how-it-works/ Note that nginx-ingress has limitations as a side effect of its Lua balancer vs normal nginx. As an example, it does NOT do TLS-resume on the nginx<->service hop. Normal nginx would, but the lua balancer lacks the necessary code [1]. In some high volume scenarios, this can cause trouble on the backend. [1] https://github.com/openresty/lua-nginx-module/pull/1312
In Ask HN: How does Kubernetes modify/add API endpoints at Runtime?
Hi from the Pages team! This was such a great find and can't thank you enough for helping ensure Private Pages is as secure as possible. This report helped uncover: - A bug in Openresty where `ngx.redirect` didn't handle unsafe characters [1]. While the fix is now in the latest version of Openresty, a quick patch was to build the URL safely before using it in the redirect. - You should check for case sensitivity when reading `__Host` prefixed cookies, and verify the values against your expected format. It's possible for both `__HOST-Foo` and `__Host-Foo` cookies to exist, and only the `__Host` prefix requires the `Secure` and `HttpOnly` attributes [2]. In our case we strip all cookies at the edge using Varnish (VCL) to ensure no user-supplied cookies make it to our origin, and now we also ignore any "Secure" cookies that don't appear to h
Read the rest
In Breaking GitHub Private Pages for $35k
Can you describe your use-case? If you are talking about the ability to select a certificate on the fly via `ssl_certificate_by_lua_block`[1] we are not aware of such functionality. If you are missing something, I would highly encourage you discuss it with the community on a github! From Oleg Guba, Traffic Team TL, co-author, and person driving the deployment: * ListenerFilters + NetworkFilters are flexible enough, that some of the custom logic could be just moved to the config. From Ruslan Nigmatullin, our head Envoy developer: If you are talking more about a custom verification code there is already couple of ways to do that: * Client TLS auth Network Filter: https://www.envoyproxy.io/docs/envoy/latest/configuration/li... * Alternatively, if you are writing C++ extension you can use Network::ReadFilter, Network::ConnectionCallbacks. [1
Read the rest
In Migrating Dropbox from Nginx to Envoy
LuaJIT is such an amazing piece of software - apparently to such an extent that only Mike Pall fully understands some of its internals. Besides being much faster than the official Lua VM, it offers extended features like the FFI library [1]. Kong[2] uses it extensively, by leveraging the underlying OpenResty[3] framework. [1] http://luajit.org/ext_ffi.html [2] https://github.com/Mashape/kong [3] https://github.com/openresty/lua-nginx-module
In LuaJIT 2.0.5 and 2.1.0-beta3 released
Openresty is fantastic. On a static website I did last year I implemented some basic login with it and some Elasticsearch full text search. If you just need some very simple REST API and don't want to start with a full blown backend server you can just script some pretty powerful stuff with it. Since a few weeks ago Openresty also has "..._by_lua_block" directives that allow you to just write some lua straight into the config without having to escape the lua code: https://github.com/openresty/lua-nginx-module#synopsis A more comprehensive guide: https://openresty.org/download/agentzh-nginx-tutorials-en.ht...
In Definitely an OpenResty guide

Showing the 15 most recent of 29 sources. Enable JavaScript to search and browse every indexed mention.

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.