鼎鼎知识库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

OpenResty安装

下载

--下载:wget https://openresty.org/download/openresty-1.13.6.2.tar.gz
--解压:tar -xzf openresty-1.13.6.2.tar.gz

目录

进入目录:cd openresty-1.13.6.2
列出内容:ll
查看当前OpenResty给予Nginx哪个版本开发:cd bundle, ll, 可以看到nginx的某个版本	

编译

--查看帮助文件:./configure --help | more
--编译:./configure

添加lua代码

--配置文件:sudo nano /etc/nginx/nginx.conf

	server {
		listen 80;
		server_name: example.com
		
		locatioin /lua {
			default_type text/html;
			content_by_lua 'ngx.say("User-Agent:", ngx.req.get_headers()["User-Agent"])' //放在body
		}
	}

运行