0

As we need to log response body at certain cases, ngx_lua module seems the solution, but, then, we found that we need to install OpenResty, which has a different NGiNX binary, and not related to previous installed NGiNX.

How smooth it can be to fully migrate previously installed NGiNX settings to a OpenResty? Or use ngx_lua inside the current NGiNX server?

I searched and did not find any useful resource, official docs on OpenResty do not discuss such a case, when NGiNX is already running and has active settings, how can we use those same settings while using OpenResty? what's the recommended way?

simo
  • 150
  • 9
  • You may want to look [here](https://www.getpagespeed.com/server-setup/nginx/how-to-add-lua-scripting-power-to-your-nginx-in-under-one-minute) for the NGINX Lua module that is compatible to official NGINX builds (commercial). The other alternative is NGINX Plus. If you're using official NGINX, you will experience zero-downtime migration. This is a matter of installing additional package on CentOS/RHEL. – Danila Vershinin Jul 23 '20 at 09:40
  • So, we don't have to use OpenResty? – simo Jul 23 '20 at 09:46
  • OpenResty is barely a name to Lua NGINX module and several supporting Lua modules/scripts. If you are not OK with using the commercial alternatives suggested, you can also create [installable packages](https://www.nginx.com/blog/creating-installable-packages-dynamic-modules/) for the Lua module, which will be the freeware approach (but of course much more hassle). – Danila Vershinin Jul 23 '20 at 09:48
  • Would you accept other solutions for "we need to log response body at certain cases"? – Gerard H. Pille Jul 23 '20 at 10:40
  • Sure, if there are easier solutions, why not. Actually, I am thinking to add a response header at app level that has the error message, and log that header in Nginx `$upstream_http_name` which does not need any module to install.. what do you think? – simo Jul 23 '20 at 11:31

0 Answers0