2

I have tried the installation steps for lua module mentioned here http://openresty.org/en/getting-started.html

resty -e 'print("hello, world")'

works

But when i try to restart nginx i get the following error

nginx: [emerg] unknown directive "content_by_lua_block" in /etc/nginx/nginx.conf:11

Configuration file is same as mentioned in the link above.

Nginx was install using apt-get Output of current nginx -V

nginx version: nginx/1.14.0 (Ubuntu)
built with OpenSSL 1.1.0g  2 Nov 2017
TLS SNI support enabled
configure arguments: --with-cc-opt='-g -O2 -fdebug-prefix-map=/build/nginx-FIJPpj/nginx-1.14.0=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Wdate-time -D_FORTIFY_SOURCE=2' --with-ld-opt='-Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -fPIC' --prefix=/usr/share/nginx --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --lock-path=/var/lock/nginx.lock --pid-path=/run/nginx.pid --modules-path=/usr/lib/nginx/modules --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --with-debug --with-pcre-jit --with-http_ssl_module --with-http_stub_status_module --with-http_realip_module --with-http_auth_request_module --with-http_v2_module --with-http_dav_module --with-http_slice_module --with-threads --with-http_addition_module --with-http_geoip_module=dynamic --with-http_gunzip_module --with-http_gzip_static_module --with-http_image_filter_module=dynamic --with-http_sub_module --with-http_xslt_module=dynamic --with-stream=dynamic --with-stream_ssl_module --with-mail=dynamic --with-mail_ssl_module
10
  • stackoverflow.com/a/53005072/5449500 Checkout my old answer Commented May 10, 2019 at 11:23
  • Possible duplicate of Adding LUA module to nginx Commented May 10, 2019 at 11:24
  • 1
    @Akshaybarahate I already have nginx installed. I did see your answer. It is very comprehensive but i am not sure which point applies to my scenario as i already have nginx installed and do not want to reinstall nginx. Commented May 10, 2019 at 11:28
  • how you installed the nginx? Using tarball approach or direct command like yum and apt Commented May 10, 2019 at 12:14
  • Add OS information please Commented May 10, 2019 at 12:43

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.