Nginx Alpine image, support Lua 、nginx-echo 、nginx-brotli 、nginx-http-concat 、WebP 、TLSv1.3
Nginx v1.14.2 Alpine 镜像,支持 以下模块:
# ./nginx.conf
server {
...
}
docker run \
--name nginx \
-v "$(pwd)/nginx.conf":/etc/nginx/conf.d/default.conf \
-p 80:80 \
-p 443:443 \
ghcr.io/shangxianapp/nginx:latest-alpine
docker run \
--name nginx \
-v "$(pwd)/nginx.conf":/etc/nginx/nginx.conf \
-v "$(pwd)/vhost":/etc/nginx/vhost \
-p 80:80 \
-p 443:443 \
ghcr.io/shangxianapp/nginx:latest-alpine
二次 LuaRocks 安装:
FROM ghcr.io/shangxianapp/nginx:latest-alpine
WORKDIR /etc/nginx
RUN luarocks install lua-cjson
RUN luarocks install luasocket
COPY . .
EXPOSE 80 443
CMD ["nginx", "-g", "daemon off;"]%
为了让 Lua 有写入文件权限,在创建 nginx
用户时使用了 -u 1000
以提高用户权限。
make build
为了测试 HTTPS 支持,请添加 Hosts 127.0.0.1 www.fe.com
,并运行:
make test
MIT