[关闭]
@adonia 2018-05-25T06:18:43.000000Z 字数 3090 阅读 161

nginx lua

nginx


nginx如需支持lua,需要在编译nginx源码时指定支持lua的module。这里直接使用OpenResty

  1. /usr/local/openresty # ls -l
  2. total 188
  3. drwxr-xr-x 2 root root 4096 Nov 18 2016 bin
  4. drwxr-xr-x 6 root root 4096 Nov 18 2016 luajit
  5. drwxr-xr-x 6 root root 4096 Nov 18 2016 lualib
  6. drwxr-xr-x 13 root root 4096 May 24 05:13 nginx
  7. drwxr-xr-x 43 root root 4096 Nov 18 2016 pod
  8. -rw-r--r-- 1 root root 165176 Nov 18 2016 resty.index
  9. drwxr-xr-x 5 root root 4096 Nov 18 2016 site

nginx的目录结构:

  1. /usr/local/openresty/nginx # ls -l
  2. total 40
  3. drwx------ 2 nobody root 4096 May 24 05:13 client_body_temp
  4. drwxr-xr-x 2 root root 4096 Nov 18 2016 conf
  5. drwx------ 2 nobody root 4096 May 24 05:13 fastcgi_temp
  6. drwxr-xr-x 2 root root 4096 Nov 18 2016 html
  7. drwxr-xr-x 2 root root 4096 May 24 05:13 logs
  8. drwxr-xr-x 2 root root 4096 Nov 18 2016 modules
  9. drwx------ 2 nobody root 4096 May 24 05:13 proxy_temp
  10. drwxr-xr-x 2 root root 4096 Nov 18 2016 sbin
  11. drwx------ 2 nobody root 4096 May 24 05:13 scgi_temp
  12. drwx------ 2 nobody root 4096 May 24 05:13 uwsgi_temp
  1. docker run --rm -d -p 8080:80 --volume $PWD/conf:/usr/local/openresty/nginx/conf --volume $PWD/log:/var/log/nginx --volume $PWD/html:/usr/share/nginx/html openresty/openresty
  1. nginx version: openresty/1.11.2.2
  2. built by gcc 5.3.0 (Alpine 5.3.0)
  3. built with OpenSSL 1.0.2j 26 Sep 2016
  4. TLS SNI support enabled
  5. configure arguments: --prefix=/usr/local/openresty/nginx --with-cc-opt=-O2 --add-module=../ngx_devel_kit-0.3.0 --add-module=../echo-nginx-module-0.60 --add-module=../xss-nginx-module-0.05 --add-module=../ngx_coolkit-0.2rc3 --add-module=../set-misc-nginx-module-0.31 --add-module=../form-input-nginx-module-0.12 --add-module=../encrypted-session-nginx-module-0.06 --add-module=../srcache-nginx-module-0.31 --add-module=../ngx_lua-0.10.7 --add-module=../ngx_lua_upstream-0.06 --add-module=../headers-more-nginx-module-0.32 --add-module=../array-var-nginx-module-0.05 --add-module=../memc-nginx-module-0.17 --add-module=../redis2-nginx-module-0.13 --add-module=../redis-nginx-module-0.3.7 --add-module=../rds-json-nginx-module-0.14 --add-module=../rds-csv-nginx-module-0.07 --with-ld-opt=-Wl,-rpath,/usr/local/openresty/luajit/lib --with-openssl=/tmp/openssl-1.0.2j --with-pcre=/tmp/pcre-8.39 --with-file-aio --with-http_addition_module --with-http_auth_request_module --with-http_dav_module --with-http_flv_module --with-http_geoip_module=dynamic --with-http_gunzip_module --with-http_gzip_static_module --with-http_image_filter_module=dynamic --with-http_mp4_module --with-http_random_index_module --with-http_realip_module --with-http_secure_link_module --with-http_slice_module --with-http_ssl_module --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-http_xslt_module=dynamic --with-ipv6 --with-mail --with-mail_ssl_module --with-md5-asm --with-pcre-jit --with-sha1-asm --with-stream --with-stream_ssl_module --with-threads
  • --add-module=../ngx_lua-0.10.7 --add-module=../ngx_lua_upstream-0.06即启动支持lua的module
  • /usr/local/openresty/nginx/sbin/nginx为openresty中nginx的启动入口。
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注