
truespirit/openresty本镜像基于OpenResty构建,作为反向认证代理使用,集成了lua-resty-session和lua-resty-openidc模块,提供身份验证和会话管理能力,适用于需要对后端服务进行认证保护的场景。
构建时使用以下配置选项:
bash--with-compat \ --with-file-aio \ --with-http_addition_module \ --with-http_auth_request_module \ --with-http_dav_module \ --with-http_flv_module \ --with-http_geoip_module=dynamic \ --with-http_gunzip_module \ --with-http_gzip_static_module \ --with-http_image_filter_module=dynamic \ --with-http_mp4_module \ --with-http_random_index_module \ --with-http_realip_module \ --with-http_secure_link_module \ --with-http_slice_module \ --with-http_ssl_module \ --with-http_stub_status_module \ --with-http_sub_module \ --with-http_v2_module \ --with-http_v3_module \ --with-http_xslt_module=dynamic \ --with-ipv6 \ --with-mail \ --with-mail_ssl_module \ --with-md5-asm \ --with-sha1-asm \ --with-stream \ --with-stream_realip_module \ --with-stream_ssl_preread_module \ --with-stream_ssl_module \ --with-threads
使用lua-resty-ipmatcher模块进行IP地址匹配:
lualocal ipmatcher = require "resty.ipmatcher" -- 创建IP匹配器,支持IP地址和CIDR范围 local ip, err = ipmatcher.new({ "127.0.0.1", "192.168.0.0/16", "::1", "fe80::/16", }) -- 检查IP是否匹配 local ok, err = ip:match("127.0.0.1") -- 返回 true
bashdocker run -d -p 80:80 -p 443:443 \ -v /path/to/nginx.conf:/usr/local/openresty/nginx/conf/nginx.conf \ --name openresty-auth-proxy \ [镜像名称]
nginxworker_processes auto; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; server { listen 80; location / { # 配置OpenID Connect认证 access_by_lua_block { local opts = { discovery = "https://your-oidc-provider/.well-known/openid-configuration", client_id = "your-client-id", client_secret = "your-client-secret", redirect_uri = "http://your-proxy/callback", scope = "openid email profile" } local res, err = require("resty.openidc").authenticate(opts) if err then ngx.status = 500 ngx.say(err) ngx.exit(ngx.HTTP_INTERNAL_SERVER_ERROR) end } # 反向代理到后端服务 proxy_pass http://backend-service:8080; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; } } }




探索更多轩辕镜像的使用方法,找到最适合您系统的配置方式
通过 Docker 登录认证访问私有仓库
无需登录使用专属域名
Kubernetes 集群配置 Containerd
K3s 轻量级 Kubernetes 镜像加速
VS Code Dev Containers 配置
Podman 容器引擎配置
HPC 科学计算容器配置
ghcr、Quay、nvcr 等镜像仓库
Harbor Proxy Repository 对接专属域名
Portainer Registries 加速拉取
Nexus3 Docker Proxy 内网缓存
需要其他帮助?请查看我们的 常见问题Docker 镜像访问常见问题解答 或 提交工单
manifest unknown
no matching manifest(架构)
invalid tar header(解压)
TLS 证书失败
DNS 超时
410 Gone 排查
402 与流量用尽
401 认证失败
429 限流
D-Bus 凭证提示
413 与超大单层
来自真实用户的反馈,见证轩辕镜像的优质服务