
如果你使用 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 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
本镜像为httpbin的自定义分支,针对个人需求进行了更新和优化。由于https://github.com/postmanlabs/httpbin长期未更新,作者维护了此版本,提供HTTP请求与响应测试功能,支持多种Web服务器配置。
| 标签 | 说明 | 基础镜像 | 特性 |
|---|---|---|---|
:latest | 基础httpbin,使用gunicorn | Debian | 仅HTTP |
:alpine | 基础httpbin,使用gunicorn | Alpine Linux | 仅HTTP,轻量级 |
:nginx | 集成nginx和uwsgi | nginx:alpine | 支持HTTPS/HTTP2 |
:unit | 集成nginx unit | Alpine | 支持HTTPS/HTTP2 |
:httpd | 集成httpd和uwsgi | httpd:latest | 支持HTTPS |
:httpd-alpine | 集成httpd和uwsgi | httpd:alpine | 支持HTTPS,轻量级 |
:nginx
/etc/nginx/ssl/dhparam.pem/etc/nginx/ssl/eccert.pem (ecdsa证书)/etc/nginx/ssl/eckey.pem (ecdsa密钥)/etc/nginx/ssl/cert.pem (rsa证书)/etc/nginx/ssl/key.pem (rsa密钥)/etc/nginx/ssl/chain.pem/etc/nginx/nginx.conf/etc/uwsgi/uwsgi.ini:unit
/var/lib/unit/certs/bundle (证书 bundle,需按 cat cert.pem cachain.pem key.pem > bundle 格式创建)/var/lib/unit/conf.json:httpd 和 :httpd-alpine
/usr/local/apache2/conf/ssl/dhparam.pem/usr/local/apache2/conf/ssl/eccert.pem (ecdsa证书)/usr/local/apache2/conf/ssl/eckey.pem (ecdsa密钥)/usr/local/apache2/conf/ssl/cert.pem (rsa证书)/usr/local/apache2/conf/ssl/key.pem (rsa密钥)/usr/local/apache2/conf/ssl/chain.pem/usr/local/apache2/conf/httpd.conf/usr/local/apache2/conf/extra/vhosts/*.conf/etc/uwsgi/uwsgi.inish# 运行基础版本(仅HTTP) docker run -p 80:80 docker.xuanyuan.run/simonkowallik/httpbin # 运行nginx版本(支持HTTPS/HTTP2) docker run -p 80:80 -p 443:443 docker.xuanyuan.run/simonkowallik/httpbin:nginx # 运行httpd版本 docker run -p 80:80 -p 443:443 docker.xuanyuan.run/simonkowallik/httpbin:httpd # 运行httpd-alpine版本 docker run -p 80:80 -p 443:443 docker.xuanyuan.run/simonkowallik/httpbin:httpd-alpine # 运行unit版本 docker run -p 80:80 -p 443:443 docker.xuanyuan.run/simonkowallik/httpbin:unit
在每个响应中返回自定义HTTP头
通过环境变量 XHTTPBIN_X_<header-name> 设置自定义HTTP头:
shelldocker run -it --rm -p 80:80 -p 443:443 \ -e XHTTPBIN_X_instance_id="instance-id-1" \ ***-ghcr.xuanyuan.run/simonkowallik/httpbin:unit
验证自定义头:
shellcurl -vsk http://localhost/get # 响应中将包含: # < X-instance-id: instance-id-1
在/tags端点设置自定义标签
通过环境变量 HTTPBIN_<tag-name> 设置自定义标签:
shelldocker run -it --rm -p 80:80 -p 443:443 \ -e HTTPBIN_Instance=1 \ -e HTTPBIN_2ndTag="Some Value" \ ***-ghcr.xuanyuan.run/simonkowallik/httpbin:nginx
访问/tags端点查看标签:
shellcurl -vsk http://localhost/tags # 响应: # { # "2ndTag": "Some Value", # "Instance": "1" # }
感谢 https://github.com/v-slenter 对 #9 的贡献。
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
来自真实用户的反馈,见证轩辕镜像的优质服务