标签:git clu 性能优化 hub nginx安全 content usr rect nginx
#安装lua
yum install -y lua
lua -v
wget http://luajit.org/download/LuaJIT-2.0.2.tar.gz
tar -zxvf LuaJIT-2.0.2.tar.gz
cd LuaJIT-2.0.2
make install PREFIX=/usr/local/LuaJIT/2.0.2
export LUAJIT_LIB=/usr/local/LuaJIT/2.0.2/lib
export LUAJIT_INC=/usr/local/LuaJIT/2.0.2/include/luajit-2.0
echo "/usr/local/LuaJIT/2.0.2/lib" >> /etc/ld.so.conf
ldconfig
wget https://github.com/simpl/ngx_devel_kit/archive/v0.3.0.tar.gz https://github.com/openresty/lua-nginx-module/archive/v0.10.9rc7.tar.gz
tar -zxvf v0.10.9rc7.tar.gz
tar -zxvf v0.3.0.tar.gz
#先make clean,然后在原有的nginx ./configure基础上,添加新的模块
#如果出现undefined reference to `X509_check_host‘错误,需要添加--with-openssl选项,指向openssl 1.0.2安装包源码所在的目录。
./configure --add-module=/path/to/ngx_devel_kit-0.3.0 --add-module=/path/to/lua-nginx-module-0.10.9rc7
--with-openssl=/path/to/openssl-1.0.2k
make && make install
https://www.hardill.me.uk/wordpress/2018/03/14/logging-requests-and-response-with-nginx/
指令 | 说明 |
---|---|
set_by_lua, set_by_lua_file | 设置Nginx变量 |
access_by_llua, access_by_lua_file | 访问控制 |
content_by_lua, content_by_lua_file | 接收请求,输出响应 |
变量 | 说明 |
---|---|
ngx.var | nginx变量 |
ngx.req.get_headers | 获取请求头 |
ngx.req.get_uri_args | 获取请求参数 |
ngx.redirect | 重定向 |
ngx.print | 输出内容 |
ngx.say | 同ngx.print,会多一个换行符 |
ngx.header | 输出响应头 |
... | ... |
标签:git clu 性能优化 hub nginx安全 content usr rect nginx
原文地址:https://www.cnblogs.com/zy108830/p/12600385.html