<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></head><body dir="auto"><div dir="auto">nginx upstream has nothing to do with the NGINX packages in Ubuntu.</div><div dir="auto"><br></div><div dir="auto">The Lua module in Ubuntu was removed and dropped by the Server Team's decision that supporting it requires excess work into the future that they were not willing to support as well as additional modules like resty core just to make Lua work.</div><div dir="auto"><br></div><div dir="auto">You need to go and install OpenResty's nginx fork and modules to get Lua in ubuntu 20.04. Also, the Lua module is not maintained by NGINX either.</div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto"><br></div><div id="composer_signature" dir="auto"><div style="font-size:85%;color:#575757" dir="auto">Sent from my T-Mobile 5G Device</div></div><div dir="auto"><br></div><div><br></div><div align="left" dir="auto" style="font-size:100%;color:#000000"><div>-------- Original message --------</div><div>From: BELUCHE Yannick <yannick.beluche@thalesgroup.com> </div><div>Date: 11/23/21 09:38 (GMT-05:00) </div><div>To: nginx@nginx.org </div><div>Subject: Enabling lua in Nginx 1.18.0 </div><div><br></div></div>
<div class="WordSection1">
<p class="MsoNormal">Hello,</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"><span lang="EN-US">I installed Nginx and Nginx-extra on an Ubuntu Focal 20.04.2 LTS server. I wanted to use access_by_lua directive and I got an error :
</span></p>
<p class="MsoNormal"><i><span lang="EN-US">$> nginx –t</span></i></p>
<p class="MsoNormal"><b><span lang="EN-US">nginx: [emerg] unknown directive “access_by_lua” in /etc/nginx/nginx-lua-headers.conf:91</span></b></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US">However it seems by typing nginx –V that the http-lua module is installed :
</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><i><span lang="EN-US">$> nginx –V 2>1& | tr ' ' '\n'</span></i></p>
<p class="MsoNormal"><span lang="EN-US">nginx<br>
version:<br>
nginx/1.18.0<br>
(Ubuntu)<br>
built<br>
with<br>
OpenSSL<br>
1.1.1f<br>
<br>
31<br>
Mar<br>
2020<br>
TLS<br>
SNI<br>
support<br>
enabled<br>
configure<br>
arguments:<br>
--with-cc-opt='-g<br>
-O2<br>
-fdebug-prefix-map=/build/nginx-KTLRnK/nginx-1.18.0=.<br>
-fstack-protector-strong<br>
-Wformat<br>
-Werror=format-security<br>
-fPIC<br>
-Wdate-time<br>
-D_FORTIFY_SOURCE=2'<br>
--with-ld-opt='-Wl,-Bsymbolic-functions<br>
-Wl,-z,relro<br>
-Wl,-z,now<br>
-fPIC'<br>
--prefix=/usr/share/nginx<br>
--conf-path=/etc/nginx/nginx.conf<br>
--http-log-path=/var/log/nginx/access.log<br>
--error-log-path=/var/log/nginx/error.log<br>
--lock-path=/var/lock/nginx.lock<br>
--pid-path=/run/nginx.pid<br>
--modules-path=/usr/lib/nginx/modules<br>
--http-client-body-temp-path=/var/lib/nginx/body<br>
--http-fastcgi-temp-path=/var/lib/nginx/fastcgi<br>
--http-proxy-temp-path=/var/lib/nginx/proxy<br>
--http-scgi-temp-path=/var/lib/nginx/scgi<br>
--http-uwsgi-temp-path=/var/lib/nginx/uwsgi<br>
--with-debug<br>
--with-compat<br>
--with-pcre-jit<br>
--with-http_ssl_module<br>
--with-http_stub_status_module<br>
--with-http_realip_module<br>
--with-http_auth_request_module<br>
--with-http_v2_module<br>
--with-http_dav_module<br>
--with-http_slice_module<br>
--with-threads<br>
--with-http_addition_module<br>
--with-http_flv_module<br>
--with-http_geoip_module=dynamic<br>
--with-http_gunzip_module<br>
--with-http_gzip_static_module<br>
--with-http_image_filter_module=dynamic<br>
--with-http_mp4_module<br>
--with-http_perl_module=dynamic<br>
--with-http_random_index_module<br>
--with-http_secure_link_module<br>
--with-http_sub_module<br>
--with-http_xslt_module=dynamic<br>
--with-mail=dynamic<br>
--with-mail_ssl_module<br>
--with-stream=dynamic<br>
--with-stream_ssl_module<br>
--with-stream_ssl_preread_module<br>
--add-dynamic-module=/build/nginx-KTLRnK/nginx-1.18.0/debian/modules/http-headers-more-filter<br>
--add-dynamic-module=/build/nginx-KTLRnK/nginx-1.18.0/debian/modules/http-auth-pam<br>
--add-dynamic-module=/build/nginx-KTLRnK/nginx-1.18.0/debian/modules/http-cache-purge<br>
--add-dynamic-module=/build/nginx-KTLRnK/nginx-1.18.0/debian/modules/http-dav-ext<br>
--add-dynamic-module=/build/nginx-KTLRnK/nginx-1.18.0/debian/modules/http-ndk<br>
--add-dynamic-module=/build/nginx-KTLRnK/nginx-1.18.0/debian/modules/http-echo<br>
--add-dynamic-module=/build/nginx-KTLRnK/nginx-1.18.0/debian/modules/http-fancyindex<br>
--add-dynamic-module=/build/nginx-KTLRnK/nginx-1.18.0/debian/modules/nchan<br>
<b>--add-dynamic-module=/build/nginx-KTLRnK/nginx-1.18.0/debian/modules/http-lua<br>
</b>--add-dynamic-module=/build/nginx-KTLRnK/nginx-1.18.0/debian/modules/rtmp<br>
--add-dynamic-module=/build/nginx-KTLRnK/nginx-1.18.0/debian/modules/http-uploadprogress<br>
--add-dynamic-module=/build/nginx-KTLRnK/nginx-1.18.0/debian/modules/http-upstream-fair<br>
--add-dynamic-module=/build/nginx-KTLRnK/nginx-1.18.0/debian/modules/http-subs-filter<br>
--add-dynamic-module=/build/nginx-KTLRnK/nginx-1.18.0/debian/modules/http-geoip2</span><span style="font-size:12.0pt;mso-fareast-language:FR" lang="EN-US"></span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US">the weird thing is that I did the same thing on an older version of Ubuntu (Xenial – 16.04.2 LTS) (ie: apt install nginx nginx-extras) and the directive “access_by_lua” works out of the box on it…</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US">Can someone please help me with that ?</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US">Thanks in advance!</span></p>
<p class="MsoNormal"><span lang="EN-US">Regards,</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US">Yannick</span></p>
</div>
</body></html>