
如果你使用 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 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
!size!https://github.com/11notes/defaults/blob/main/static/img/transparent5x2px.png?raw=true!version!https://github.com/11notes/defaults/blob/main/static/img/transparent5x2px.png?raw=true!pulls!https://github.com/11notes/defaults/blob/main/static/img/transparent5x2px.png?raw=true%5B](https://github.com/11notes/docker-NGINX/issues)!https://github.com/11notes/defaults/blob/main/static/img/transparent5x2px.png?raw=true!swiss_made
Nginx,轻量级且无发行版,可用于反向代理后端或作为完整版本的代理服务器。
nginx(engine x)是一款HTTP Web服务器、反向代理、内容缓存、负载均衡器、TCP/UDP代理服务器及邮件代理服务器。
我能用它做什么? 该镜像可作为需要高性能Web服务器的Nginx相关镜像基础。默认标签版本移除了反向代理可提供的大部分功能,但保留了重要的Web服务器功能(如brotli压缩)。默认标签版本不适合作为反向代理运行,如需此功能请使用完整版本。例如,默认标签版本不支持HTTPS!
为什么我应该使用此镜像而非其他现有镜像? 这是个好问题!因为...
如果您重视安全性、简洁性和极致优化,此镜像可能适合您。
以下是本镜像与其他常用/官方镜像的对比:
| 镜像 | 磁盘大小 | 默认用户 | https://github.com/11notes/RTFM/blob/main/linux/container/image/distroless.md | 支持架构 |
|---|---|---|---|---|
| 11notes/nginx:1.28.0 | 3MB | 1000:1000 | ✅ | armv7, amd64, arm64 |
| nginx:1.28.0 | 192MB | 0:0 | ❌ | amd64, armv5, armv7, arm64v8, 386, mips64le, ppc64le, s390x |
yamlworker_processes auto; worker_cpu_affinity auto; worker_rlimit_nofile 204800; error_log /nginx/log/error.log warn; daemon off; events { worker_connections 1024; use epoll; multi_accept on; } http { log_format main escape=json '{"log":"main","time":"$time_iso8601","server":{"name":"$server_name", "protocol":"$server_protocol"}, "client":{"ip":"$remote_addr", "x-forwarded-for":"$http_x_forwarded_for", "user":"$remote_user"},"request":{"method":"$request_method", "url":"$request_uri", "time":"$request_time", "status":$status}}'; log_format proxy escape=json '{"log":"proxy", "time":"$time_iso8601","server":{"name":"$server_name", "protocol":"$server_protocol"}}, "client":{"ip":"$remote_addr", "x-forwarded-for":"$http_x_forwarded_for", "user":"$remote_user"},"request":{"method":"$request_method", "url":"$request_uri", "time":"$request_time", "status":$status}, "proxy":{"host":"$upstream_addr", "time":{"connect":"$upstream_connect_time", "response":"$upstream_response_time", "header":"$upstream_header_time"}, "io":{"bytes":{"sent":"$upstream_bytes_sent", "received":"$upstream_bytes_received"}}, "cache":"$upstream_cache_status", "status":"$upstream_status"}}'; access_log off; server_tokens off; include mime.types; default_type application/octet-stream; sendfile on; aio on; tcp_nopush on; tcp_nodelay on; gzip on; brotli on; brotli_comp_level 4; brotli_static on; brotli_types text/plain text/css text/xml text/javascript text/x-component application/xml application/xml+rss application/javascript application/json application/atom+xml application/vnd.ms-fontobject application/x-font-ttf application/x-font-opentype application/x-font-truetype application/x-web-app-manifest+json application/xhtml+xml application/octet-stream font/opentype font/truetype font/eot font/otf image/svg+xml image/x-icon image/vnd.microsoft.icon image/bmp; client_max_body_size 8M; keepalive_timeout 90; keepalive_requests 102400; reset_timedout_connection on; client_body_timeout 10; send_timeout 5; open_file_cache max=204800 inactive=5m; open_file_cache_valid 2m; open_file_cache_min_uses 2; open_file_cache_errors off; root /nginx/var; include /nginx/etc/*.conf; }
默认配置不含特殊设置,启用了brotli压缩,将工作进程数设置为可用CPU核心数,提供两种默认日志格式,禁用了非必要功能,并启用了最佳性能设置。如需修改Nginx配置,请挂载自定义配置文件。
.conf结尾yamlname: "nginx" services: nginx: image: "11notes/nginx:1.28.0" read_only: true environment: TZ: "Europe/Zurich" ports: - "3000:3000/tcp" networks: frontend: volumes: - "etc:/nginx/etc" - "var:/nginx/var" tmpfs: - "/nginx/cache:uid=1000,gid=1000" - "/nginx/run:uid=1000,gid=1000" restart: "always" volumes: etc: var: networks: frontend:
| 参数 | 值 | 描述 |
|---|---|---|
user | docker | 用户名 |
uid | 1000 | 用户标识符 |
gid | 1000 | 组标识符 |
home | /nginx | docker用户的主目录 |
| 参数 | 说明 | 默认值 |
|---|---|---|
TZ | 时区 | 无 |
DEBUG | 启用容器镜像和应用的调试模式(如支持) | 无 |
以下是镜像的主要标签。此外,每个提交及其简写sha256值也对应一个标签。
我认为:latest标签存在风险。我曾多次对镜像引入破坏性变更,这可能会给部分用户带来问题。如果您不想将标签更新至最新语义化版本,可使用语义化版本的短版本号。例如,无需使用:1.28.0,可使用:1或:1.28。由于这些标签会随新版本自动更新,使用它们与使用:latest类似,但至少固定在主版本或次版本级别。
如果您仍坚持使用最新版本,可使用:rolling标签,但请注意!这将直接获取应用的最新版本,无论是否存在破坏性变更或安全问题,风险自负!
docker pull 11notes/nginx:1.28.0 docker pull ghcr.io/11notes/nginx:1.28.0 docker pull quay.io/11notes/nginx:1.28.0
此镜像不基于其他镜像,而是以https://hub.docker.com/_/scratch%E4%B8%BA%E5%9F%BA%E7%A1%80%E5%B1%82%E6%9E%84%E5%BB%BA%E3%80%82%E5%8C%85%E5%90%AB%E4%BB%A5%E4%B8%8B%E6%97%A0%E5%8F%91%E8%A1%8C%E7%89%88%E5%B1%82%EF%BC%9A
此镜像仅供您自行承担风险使用。更新镜像版本前请务必备份。查看https://github.com/11notes/docker-nginx/releases%E4%BA%86%E8%A7%A3%E7%A0%B4%E5%9D%8F%E6%80%A7%E5%8F%98%E6%9B%B4%E3%80%82%E5%A6%82%E4%BD%BF%E7%94%A8%E4%B8%AD%E9%81%87%E5%88%B0%E9%97%AE%E9%A2%98%EF%BC%8C%E8%AF%B7%E6%8F%90%E4%BA%A4https://github.com/11notes/docker-nginx/issues%E3%80%82%E5%A6%82%E6%9C%89%E7%96%91%E9%97%AE%E6%88%96%E5%BB%BA%E8%AE%AE%EF%BC%8C%E8%AF%B7%E5%88%9B%E5%BB%BAhttps://github.com/11notes/docker-nginx/discussions%E8%80%8C%E9%9D%9Eissue%E3%80%82%E6%82%A8%E5%8F%AF%E5%9C%A8https://github.com/11notes?tab=repositories%E6%9F%A5%E7%9C%8B%E6%88%91%E7%9A%84%E6%89%80%E6%9C%89%E5%85%B6%E4%BB%96%E4%BB%93%E5%BA%93%E3%80%82
创建于 02.09.2025, 01:45:08 (CET)
以下是 11notes/nginx 相关的常用 Docker 镜像,适用于 反向代理、负载均衡、静态资源服务 等不同场景:
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。

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