如果你使用 DeepSeek、元宝 AI、Copilot、ChatGPT 等 AI 工具,协助配置轩辕镜像、编写 docker pull 命令、修改 Docker Compose 镜像地址、配置镜像加速、排查镜像拉取失败、分析报错日志等问题,请先让 AI 阅读并遵守轩辕镜像的规则文档。
只需在 AI 对话中先发送下面这句话即可:
请先完整阅读并严格遵守以下文档中的全部规则与要求:
https://xuanyuan.cloud/agents.md
在未充分阅读并理解该文档前,不要生成任何命令、配置、修改建议、故障排查方案或技术回答。后续所有输出都必须严格以该文档中的规范为最高优先级执行。查看 agents.md 用法指南与完整示范。国内用户首推 元宝 AI、DeepSeek 的深度思考模式,不推荐豆包 AI;Cursor 等编辑器可在对话 @ 该链接,或加入 User Rules。 若 AI 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
本镜像为基于Ubuntu bionic系统从源码构建的Nginx服务器镜像,提供灵活的配置选项和丰富的模块支持,适用于各类Web服务场景。
1.17.0、latest nginx/Dockerfile1.16.0、stable nginx/Dockerfile1.15.12 nginx/Dockerfile1.14.2 nginx/Dockerfile镜像构建时使用以下核心配置参数,确保功能完整性和性能优化:
--prefix=/usr/share/nginx # 安装前缀 --sbin-path=/usr/sbin/nginx # 可执行文件路径 --conf-path=/etc/nginx/nginx.conf # 主配置文件路径 --http-log-path=/var/log/nginx/access.log # HTTP访问日志路径 --error-log-path=/var/log/nginx/error.log # 错误日志路径 --lock-path=/var/lock/nginx.lock # 锁文件路径 --pid-path=/run/nginx.pid # PID文件路径 --modules-path=/usr/lib/nginx/modules # 模块存放路径 --http-client-body-temp-path=/var/lib/nginx/body # 客户端请求体临时文件路径 --http-fastcgi-temp-path=/var/lib/nginx/fastcgi # FastCGI临时文件路径 --http-proxy-temp-path=/var/lib/nginx/proxy # 代理临时文件路径 --http-scgi-temp-path=/var/lib/nginx/scgi # SCGI临时文件路径 --http-uwsgi-temp-path=/var/lib/nginx/uwsgi # uWSGI临时文件路径
支持多种关键功能模块,包括但不限于:
--with-debug)--with-pcre-jit)--with-http_ssl_module)--with-http_stub_status_module)--with-http_realip_module)--with-http_v2_module)--with-http_dav_module)--with-threads)--with-http_flv_module、--with-http_mp4_module)--with-http_gzip_static_module)提供以下动态模块,需在主配置文件中通过load_module modules/<module_name.so>加载:
ndk_http_module.so # Nginx开发工具包模块 ngx_http_auth_pam_module.so # PAM认证模块 ngx_http_dav_ext_module.so # WebDAV扩展模块 ngx_http_echo_module.so # 回声模块 ngx_http_fancyindex_module.so # 美化索引模块 ngx_http_geoip_module.so # GeoIP模块 ngx_http_headers_more_filter_module.so # 自定义HTTP头模块 ngx_http_image_filter_module.so # 图片处理模块 ngx_http_lua_module.so # Lua脚本支持模块 ngx_http_perl_module.so # Perl脚本模块 ngx_http_uploadprogress_module.so # 上传进度模块 ngx_http_upstream_fair_module.so # 公平负载均衡模块 ngx_http_xslt_filter_module.so # XSLT过滤模块 ngx_mail_module.so # 邮件代理模块 ngx_nchan_module.so # 实时消息推送模块 ngx_rtmp_module.so # RTMP流媒体模块 ngx_stream_module.so # TCP/UDP代理模块
bashdocker run -d -p 80:80 --name my-nginx ossobv/nginx:latest
将本地配置文件挂载至容器:
bashdocker run -d -p 80:80 -p 443:443 \ -v /path/to/nginx.conf:/etc/nginx/nginx.conf \ -v /path/to/conf.d:/etc/nginx/conf.d \ -v /path/to/ssl:/etc/nginx/ssl \ --name my-nginx ossobv/nginx:latest
挂载日志目录至宿主机,避免容器重启后日志丢失:
bashdocker run -d -p 80:80 \ -v /path/to/logs:/var/log/nginx \ --name my-nginx ossobv/nginx:latest
在nginx.conf的main块中添加模块加载指令:
nginxload_module modules/ngx_http_lua_module.so; load_module modules/ngx_http_geoip_module.so; load_module modules/ngx_rtmp_module.so; http { # HTTP配置... } rtmp { # RTMP流媒体配置... }
yamlversion: '3' services: nginx: image: ossobv/nginx:latest ports: - "80:80" - "443:443" volumes: - ./nginx.conf:/etc/nginx/nginx.conf - ./conf.d:/etc/nginx/conf.d - ./ssl:/etc/nginx/ssl - ./logs:/var/log/nginx restart: always
nginx -t测试配置以下是 ossobv/nginx 相关的常用 Docker 镜像,适用于 反向代理、负载均衡、静态资源服务 等不同场景:
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。

来自真实用户的反馈,见证轩辕镜像的优质服务