12

So it might just be me that is not super bright or super unlucky when it comes to Google searches, but I can't actually find any way to run Lua in the Nginx config without having to recompile the entire server with LuaJIT. The thing is that we would like to do tiny edits of some variables without having to recompile our server on every build, which could be as much as several times a week, less complex = less stuff for us to fix.

So my question is, is there a way to run Lua in Nginx configs without having to recompile the entire thing, as we would like to keep Nginx updated by the system and not be another thing we have to maintain?

I found Nginx-extras while searching for Lua, but I can't find any data to back up that this should enable the ability to use Lua or not?

  • You may try to use http://openresty.org. – theldoria Mar 05 '14 at 15:58
  • 1
    Yeah I saw that one too, but it is also something we would have to manually download and maintain as it is in no regular repositories. –  Mar 05 '14 at 16:00
  • Shure, but on their homepage they state under Upgrading: "You can upgrade OpenResty to a newer release in the exactly same way as upgrading Nginx.". – theldoria Mar 05 '14 at 16:14
  • 1
    By which they mean manually copy and overwrite directory, we are kinda more looking for a solution that will either be a onetime deal or will be able to be upgraded along with the distribution. –  Mar 05 '14 at 20:11

2 Answers2

19

I found a solution myself to this, at least for people using Ubuntu, there is a supported working version of nginx that supports Lua and many other things, you just have to do:

apt-get install nginx-extras

Instead of the regular:

apt-get install nginx

Extras is NOT an add-on package for nginx, it is a fully compiled server, you can go here to see other version you might prefer:

http://www.cambus.net/nginx-packages-in-debian-stable/

https://wiki.debian.org/Nginx

Hope this helps you as much as it did me.

0

If you just want to install Lua support you only need to install the libnginx-mod-http-lua package:

sudo apt install libnginx-mod-http-lua
Pierz
  • 7,064
  • 52
  • 59