docker 安装openresty
1.拉取一个Openresty的镜像
docker pull openresty/openresty
2.创建配置文件
配置文件目录地址根据你自己的需求确定: /docker/openresty/conf/default.conf
3.配置文件内容
server { listen 90; listen [::]:90; server_name localhost; root /docker/www/webserver; #项目地址 index index.html; }
4.构建容器
docker run -p 90:90 -d --name openresty -v /docker/openresty/conf/default.conf:/etc/nginx/conf.d/default.conf --privileged=true openresty/openresty
如果想要在Openresty容器内部安装插件
进入容器 docker exec -it openresty bash cd /usr/local/openresty/lualib/resty/ 例如这个插件: wget https://raw.githubusercontent.com/bungle/lua-resty-template/master/lib/resty/template.lua 抛出异常:bash: wget: command not found说明没有安装wget 1. apt-get update 2. apt-get install wget
lua一些常用的扩展地址
http://www.xiaoshu168.com/lua/html.lua
http://www.xiaoshu168.com/lua/http.lua
http://www.xiaoshu168.com/lua/http_connect.lua
http://www.xiaoshu168.com/lua/http_headers.lua
http://www.xiaoshu168.com/lua/template.lua
本文由:xiaoshu168.com 作者:xiaoshu发表,转载请注明来源!