基于Alpine的OpenResty镜像,集成了luarocks、lua-prometheus、多种额外模块、RTMP流媒体支持和GeoIP2功能。
镜像概述
该镜像以Alpine为基础构建,提供轻量级的OpenResty环境,包含丰富的静态模块、动态模块及Lua模块,适用于高性能Web服务、API网关、流媒体处理等场景。
核心功能与特性
卷挂载
/usr/local/openresty/nginx/conf - 核心配置文件夹(例如包含/usr/local/openresty/nginx/conf/nginx.conf)
编译的静态模块
- https://github.com/yaoweibin/nginx_upstream_check_module
- https://github.com/weibocom/nginx-upsync-module
- https://github.com/xiaokai-wang/nginx-stream-upsync-module.git
- https://github.com/vozlt/nginx-module-stream-sts
- https://github.com/vozlt/nginx-module-sts
- https://github.com/vozlt/nginx-module-vts
- https://github.com/api7/lua-var-nginx-module
编译的动态模块
- https://github.com/google/ngx_brotli
- https://github.com/masterzen/nginx-upload-progress-module
- https://github.com/wdaike/ngx_upstream_jdomain/
- https://github.com/leev/ngx_http_geoip2_module%EF%BC%88%E5%8A%A8%E6%80%81%E6%A8%A1%E5%BC%8F%EF%BC%89
- https://github.com/winshining/nginx-http-flv-module%EF%BC%88%E5%8A%A8%E6%80%81%E6%A8%A1%E5%BC%8F%EF%BC%89
- https://github.com/Lax/traffic-accounting-nginx-module
- https://github.com/kvspb/nginx-auth-ldap
- https://github.com/slact/nchan
- https://github.com/openresty/headers-more-nginx-module
- https://github.com/openresty/replace-filter-nginx-module
- https://github.com/FRiCKLE/ngx_cache_purge
- https://github.com/fdintino/nginx-upload-module
- https://github.com/calio/form-input-nginx-module
- https://github.com/arut/nginx-dav-ext-module%EF%BC%88%E9%9C%80libxml2%E5%92%8Clibxslt%E6%94%AF%E6%8C%81%EF%BC%89
- https://github.com/Taymindis/nginx-elastic-client
已安装的Lua模块
- https://github.com/knyar/nginx-lua-prometheus
- lua-iconv
- https://github.com/ledgetech/lua-resty-http
- https://github.com/ledgetech/lua-resty-redis-connector
- https://github.com/auto-ssl/lua-resty-auto-ssl
- https://github.com/openresty/lua-resty-redis
- https://github.com/openresty/lua-resty-websocket
- https://github.com/bungle/lua-resty-libcjson
- https://github.com/thibaultcha/lua-resty-jit-uuid
- https://github.com/bungle/lua-resty-template
- https://github.com/api7/lua-var-nginx-module
- https://github.com/cloudflare/lua-resty-cookie
- https://github.com/bungle/lua-resty-session
- https://github.com/bungle/lua-resty-validation
- https://github.com/antirez/lua-cmsgpack
- lua-messagepack
- https://github.com/SkyLothar/lua-resty-jwt
- https://github.com/3scale/lua-resty-url
- https://github.com/tokers/lua-resty-requests
- https://github.com/thibaultCha/lua-cassandra
- https://github.com/perusio/lua-resty-tarantool
- https://github.com/api7/lua-resty-etcd
- https://github.com/doujiang24/lua-resty-kafka
- lapis
- https://github.com/leafo/pgmoon
启用的OpenResty模块
- compat
- file-aio
- http_addition_module
- http_auth_request_module
- http_dav_module
- http_flv_module
- http_geoip_module(动态)
- http_gunzip_module
- http_gzip_static_module
- http_image_filter_module(动态)
- http_mp4_module
- http_random_index_module
- http_realip_module
- http_secure_link_module
- http_slice_module
- http_ssl_module
- http_stub_status_module
- http_sub_module
- http_v2_module
- http_xslt_module(动态)
- ipv6
- mail
- mail_ssl_module
- md5-asm
- pcre-jit
- sha1-asm
- stream
- stream_ssl_module
- stream_realip_module
- stream_geoip_module(动态)
- threads
- http_postgres_module
- http_iconv_module
- http_postgres_module
使用场景
- 高性能Web服务器与反向代理
- API网关与请求路由
- RTMP流媒体服务部署
- 基于GeoIP2的地域访问控制
- 监控指标收集(结合lua-prometheus)
- Web应用防火墙与请求过滤
使用方法
Docker Run示例
bash
docker run -d \
-p 80:80 \
-p 443:443 \
-p 1935:1935 \ # RTMP端口
-v /path/to/your/nginx/conf:/usr/local/openresty/nginx/conf \
--name openresty \
riftbit/openresty
Docker Compose示例
yaml
version: '3'
services:
openresty:
image: riftbit/openresty
ports:
- "80:80"
- "443:443"
- "1935:1935"
volumes:
- ./nginx/conf:/usr/local/openresty/nginx/conf
restart: always
注意事项
本产品包含MaxMind创建的GeoLite2数据,可从[***]