user991 Posted July 6, 2023 Share Posted July 6, 2023 Добрый день. Обновился через opkg (видимо напрасно......) и внезапно обнаружилось что в nginx nginx: [emerg] unknown directive "content_by_lua_block" in /opt/etc/nginx/nginx.conf:43 т.е. как будто нет поддержки lua. Удаляю полностью nginx, затем opkg install nginx-mod-lua добавляю в конфиг загрузку модуля (т.к. в пакете кроме .so ничего нет) router ~ # cat /opt/etc/nginx/nginx.conf user nobody; worker_processes 1; load_module /opt/lib/nginx/modules/ngx_http_lua_module.so; #error_log /opt/var/log/nginx/error.log; #error_log /opt/var/log/nginx/error.log notice; #error_log /opt/var/log/nginx/error.log info; #pid /opt/var/run/nginx.pid; events { worker_connections 64; } http { include mime.types; default_type application/octet-stream; #log_format main '$remote_addr - $remote_user [$time_local] "$request" ' # '$status $body_bytes_sent "$http_referer" ' # '"$http_user_agent" "$http_x_forwarded_for"'; #access_log /opt/var/log/nginx/access.log main; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; #gzip on; # include sites/*; server { listen 1111; location / { content_by_lua_block { ngx.say('hello, wolld!') } } } файл на месте router ~ # ls /opt/lib/nginx/modules/ngx_http_lua_module.so /opt/lib/nginx/modules/ngx_http_lua_module.so nginx вроде собран с поддержкой динамического модуля lua router ~ # nginx -V 2>&1 | grep lua --color=always configure arguments: --target=mipsel-openwrt-linux --host=mipsel-openwrt-linux --build=x86_64-pc-linux-gnu --disable-dependency-tracking --program-prefix= --program-suffix= --prefix=/opt --exec-prefix=/opt --bindir=/opt/bin --sbindir=/opt/sbin --libexecdir=/opt/lib --sysconfdir=/opt/etc --datadir=/opt/share --localstatedir=/opt/var --mandir=/opt/share/man --infodir=/opt/share/info --crossbuild=Linux::mipsel --prefix=/opt --conf-path=/opt/etc/nginx/nginx.conf --modules-path=/opt/lib/nginx/modules --error-log-path=/opt/var/log/nginx/error.log --pid-path=/opt/var/run/nginx.pid --lock-path=/opt/var/lock/nginx.lock --http-log-path=/opt/var/log/nginx/access.log --http-client-body-temp-path=/opt/var/lib/nginx/body --http-proxy-temp-path=/opt/var/lib/nginx/proxy --http-fastcgi-temp-path=/opt/var/lib/nginx/fastcgi --http-scgi-temp-path=/opt/var/lib/nginx/scgi --http-uwsgi-temp-path=/opt/var/lib/nginx/uwsgi --with-cc=mipsel-openwrt-linux-gnu-gcc --with-cc-opt='-I/home/me/E/staging_dir/toolchain-mipsel_mips32r2_gcc-8.4.0_glibc-2.27/include -I/home/me/E/staging_dir/target-mipsel_mips32r2_glibc-2.27/opt/lib/libiconv-full/include -I/home/me/E/staging_dir/target-mipsel_mips32r2_glibc-2.27/opt/lib/libintl-full/include -O2 -pipe -mno-branch-likely -mips32r2 -mtune=mips32r2 -fno-caller-saves -fhonour-copts -msoft-float -ffunction-sections -fdata-sections -I/home/me/E/staging_dir/target-mipsel_mips32r2_glibc-2.27/opt/lib/libiconv-full/include -I/home/me/E/staging_dir/target-mipsel_mips32r2_glibc-2.27/opt/lib/libintl-full/include -DNGX_LUA_NO_BY_LUA_BLOCK' --with-ld-opt='-Wl,--dynamic-linker=/opt/lib/ld.so.1 -Wl,-rpath=/opt/lib -L/home/me/E/staging_dir/toolchain-mipsel_mips32r2_gcc-8.4.0_glibc-2.27/lib -Wl,--gc-sections -L/home/me/E/staging_dir/target-mipsel_mips32r2_glibc-2.27/opt/lib/libiconv-full/lib -Wl,-rpath-link=/home/me/E/staging_dir/target-mipsel_mips32r2_glibc-2.27/opt/lib/libiconv-full/lib -L/home/me/E/staging_dir/target-mipsel_mips32r2_glibc-2.27/opt/lib/libintl-full/lib -Wl,-rpath-link=/home/me/E/staging_dir/target-mipsel_mips32r2_glibc-2.27/opt/lib/libintl-full/lib' --without-http_upstream_zone_module --without-pcre2 --with-compat --with-http_ssl_module --with-ipv6 --with-http_gzip_static_module --with-http_stub_status_module --with-http_flv_module --with-http_dav_module --with-http_auth_request_module --with-http_v2_module --with-http_realip_module --with-http_secure_link_module --with-http_sub_module --with-stream=dynamic --with-stream_ssl_module --with-stream_ssl_preread_module --add-dynamic-module=/home/me/E/build_dir/target-mipsel_mips32r2_glibc-2.27/nginx-ssl/nginx-1.24.0/nginx-mod-naxsi/naxsi_src --add-dynamic-module=/home/me/E/build_dir/target-mipsel_mips32r2_glibc-2.27/nginx-ssl/nginx-1.24.0/nginx-mod-lua --add-dynamic-module=/home/me/E/build_dir/target-mipsel_mips32r2_glibc-2.27/nginx-ssl/nginx-1.24.0/nginx-mod-rtmp --add-dynamic-module=/home/me/E/build_dir/target-mipsel_mips32r2_glibc-2.27/nginx-ssl/nginx-1.24.0/nginx-mod-dav-ext --add-dynamic-module=/home/me/E/build_dir/target-mipsel_mips32r2_glibc-2.27/nginx-ssl/nginx-1.24.0/nginx-mod-brotli --add-dynamic-module=/home/me/E/build_dir/target-mipsel_mips32r2_glibc-2.27/nginx-ssl/nginx-1.24.0/nginx-mod-headers-more --add-dynamic-module=/home/me/E/build_dir/target-mipsel_mips32r2_glibc-2.27/nginx-ssl/nginx-1.24.0/nginx-mod-ts router ~ # nginx -V 2>&1 | grep lua --color=always configure arguments: --target=mipsel-openwrt-linux --host=mipsel-openwrt-linux --build=x86_64-pc-linux-gnu --disable-dependency-tracking --program-prefix= --program-suffix= --prefix=/opt --exec-prefix=/opt --bindir=/opt/bin --sbindir=/opt/sbin --libexecdir=/opt/lib --sysconfdir=/opt/etc --datadir=/opt/share --localstatedir=/opt/var --mandir=/opt/share/man --infodir=/opt/share/info --crossbuild=Linux::mipsel --prefix=/opt --conf-path=/opt/etc/nginx/nginx.conf --modules-path=/opt/lib/nginx/modules --error-log-path=/opt/var/log/nginx/error.log --pid-path=/opt/var/run/nginx.pid --lock-path=/opt/var/lock/nginx.lock --http-log-path=/opt/var/log/nginx/access.log --http-client-body-temp-path=/opt/var/lib/nginx/body --http-proxy-temp-path=/opt/var/lib/nginx/proxy --http-fastcgi-temp-path=/opt/var/lib/nginx/fastcgi --http-scgi-temp-path=/opt/var/lib/nginx/scgi --http-uwsgi-temp-path=/opt/var/lib/nginx/uwsgi --with-cc=mipsel-openwrt-linux-gnu-gcc --with-cc-opt='-I/home/me/E/staging_dir/toolchain-mipsel_mips32r2_gcc-8.4.0_glibc-2.27/include -I/home/me/E/staging_dir/target-mipsel_mips32r2_glibc-2.27/opt/lib/libiconv-full/include -I/home/me/E/staging_dir/target-mipsel_mips32r2_glibc-2.27/opt/lib/libintl-full/include -O2 -pipe -mno-branch-likely -mips32r2 -mtune=mips32r2 -fno-caller-saves -fhonour-copts -msoft-float -ffunction-sections -fdata-sections -I/home/me/E/staging_dir/target-mipsel_mips32r2_glibc-2.27/opt/lib/libiconv-full/include -I/home/me/E/staging_dir/target-mipsel_mips32r2_glibc-2.27/opt/lib/libintl-full/include -DNGX_LUA_NO_BY_LUA_BLOCK' --with-ld-opt='-Wl,--dynamic-linker=/opt/lib/ld.so.1 -Wl,-rpath=/opt/lib -L/home/me/E/staging_dir/toolchain-mipsel_mips32r2_gcc-8.4.0_glibc-2.27/lib -Wl,--gc-sections -L/home/me/E/staging_dir/target-mipsel_mips32r2_glibc-2.27/opt/lib/libiconv-full/lib -Wl,-rpath-link=/home/me/E/staging_dir/target-mipsel_mips32r2_glibc-2.27/opt/lib/libiconv-full/lib -L/home/me/E/staging_dir/target-mipsel_mips32r2_glibc-2.27/opt/lib/libintl-full/lib -Wl,-rpath-link=/home/me/E/staging_dir/target-mipsel_mips32r2_glibc-2.27/opt/lib/libintl-full/lib' --without-http_upstream_zone_module --without-pcre2 --with-compat --with-http_ssl_module --with-ipv6 --with-http_gzip_static_module --with-http_stub_status_module --with-http_flv_module --with-http_dav_module --with-http_auth_request_module --with-http_v2_module --with-http_realip_module --with-http_secure_link_module --with-http_sub_module --with-stream=dynamic --with-stream_ssl_module --with-stream_ssl_preread_module --add-dynamic-module=/home/me/E/build_dir/target-mipsel_mips32r2_glibc-2.27/nginx-ssl/nginx-1.24.0/nginx-mod-naxsi/naxsi_src --add-dynamic-module=/home/me/E/build_dir/target-mipsel_mips32r2_glibc-2.27/nginx-ssl/nginx-1.24.0/nginx-mod-lua --add-dynamic-module=/home/me/E/build_dir/target-mipsel_mips32r2_glibc-2.27/nginx-ssl/nginx-1.24.0/nginx-mod-rtmp --add-dynamic-module=/home/me/E/build_dir/target-mipsel_mips32r2_glibc-2.27/nginx-ssl/nginx-1.24.0/nginx-mod-dav-ext --add-dynamic-module=/home/me/E/build_dir/target-mipsel_mips32r2_glibc-2.27/nginx-ssl/nginx-1.24.0/nginx-mod-brotli --add-dynamic-module=/home/me/E/build_dir/target-mipsel_mips32r2_glibc-2.27/nginx-ssl/nginx-1.24.0/nginx-mod-headers-more --add-dynamic-module=/home/me/E/build_dir/target-mipsel_mips32r2_glibc-2.27/nginx-ssl/nginx-1.24.0/nginx-mod-ts router ~ # /opt/sbin/nginx -V 2>&1 | tr ' ' '\n' | grep lua --add-dynamic-module=/home/me/E/build_dir/target-mipsel_mips32r2_glibc-2.27/nginx-ssl/nginx-1.24.0/nginx-mod-lua что делаю не так? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.