<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="FR" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal">Hello,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></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 :
<o:p></o:p></span></p>
<p class="MsoNormal"><i><span lang="EN-US">$> nginx –t<o:p></o:p></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<o:p></o:p></span></b></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">However it seems by typing nginx –V that the http-lua module is installed :
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><i><span lang="EN-US">$> nginx –V 2>1& | tr ' ' '\n'<o:p></o:p></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 lang="EN-US" style="font-size:12.0pt;mso-fareast-language:FR"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></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…<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Can someone please help me with that ?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Thanks in advance!<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Regards,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Yannick<o:p></o:p></span></p>
</div>
</body>
</html>