使用docker部署 1 下载 # wget https://github.com/doujiang24/lua-resty-kafka/archive/v0.06.tar.gz# tar xvf v0.06.tar.gz 2 准备配置文件testkafka.conf # vi testkafka.conf lua_package_path "/usr/local/openresty/lualib/resty/kafka/?.lua;;"; lua_need_request_body…
openresty 1.15.8.1 官方:https://openresty.org/en/ 一 简介 OpenResty® is a dynamic web platform based on NGINX and LuaJIT. openresty是一个基于nginx和luajit的动态web平台: OpenResty® is a full-fledged web platform that integrates the standard Nginx core, LuaJIT, many c…
概述 重写URL是非常有用的一个功能,因为它可以让你提高搜索引擎阅读和索引你的网站的能力:而且在你改变了自己的网站结构后,无需要求用户修改他们的书签,无需其他网站修改它们的友情链接:它还可以提高你的网站的安全性:而且通常会让你的网站更加便于使用和更专业. Nginx Rewrite规则相关指令 Nginx Rewrite规则相关指令有if.rewrite.set.return.break等,其中rewrite是最关键的指令. Rewrite 重写,写在server段或者location段都可,后…
概述 location 有"定位"的意思, 根据Uri来进行不同的定位. 在虚拟主机的配置中,是必不可少的,location可以把网站的不同部分,定位到不同的处理方式上.伪静态,反向代理,负载均衡等等都离不开location. 语法 location [=|~|~*|^~] patt {} 中括号可以不写任何参数,此时称为一般匹配,也可以写参数.因此,大类型可以分为3种: location = patt {} [精准匹配] location patt{} [一般匹配] location…
Nginx日志主要分为两种:访问日志和错误日志.日志开关在Nginx配置文件(一般在server段来配置)中设置,两种日志都可以选择性关闭,默认都是打开的. 访问日志access_log #日志格式设定 log_format access '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_us…
Apache默认是把PHP作为本身的一个模块(mod_php)来运行的,而Nginx是以FastCGI方式运行的.所以使用Nginx+PHP就是直接配置为FastCGI模式. 安装PHP 下载地址: http://php.net/downloads #下载PHP cd /usr/local/src/ wget http://cn2.php.net/distributions/php-5.5.0.tar.gz #安装依赖包 yum -y install gcc make gd-devel libj…
配置文件说明 #定义Nginx运行的用户和用户组 user www www; #nginx进程数,建议设置为当前主机的CPU总核心数. worker_processes 8; #全局错误日志定义类型,[ debug | info | notice | warn | error | crit ] error_log ar/loginx/error.log info; #进程文件 pid /usr/local/nginx/logs/nginx.pid; #一个nginx进程打开的最多文件描述符数目,…
nginx的官方手册: http://nginx.org/en/docs/ 编译安装 下载地址: http://nginx.org/en/download.html # 为了支持rewrite功能,我们需要安装pcre yum install pcre* # 安装openssl,如果不需要ssl支持,请跳过这一步 yum install openssl* # 编译 ./configure --prefix=/usr/local/nginx-1.5.1 \ --with-http_ssl_modu…
openresty(nginx+lua)中获取不到post数据,ngx.req.get_body_data返回nil This function returns nil if the request body has not been read, the request body has been read into disk temporary files, or the request body has zero size. 打开nginx调试日志 error_log /var/log/ng…
原文:https://blog.csdn.net/enweitech/article/details/78519398 OpenResty 官网:http://openresty.org/  OpenResty® - 中文官方站 http://openresty.org/cn/ OpenResty 是一个nginx和它的各种三方模块的一个打包而成的软件平台.最重要的一点是它将lua/luajit打包了进来,使得我们可以使用lua脚本来进行web的开发.有了lua,我们可以借助于nginx的异步非…