轩辕镜像 官方专业版
轩辕镜像
专业版
轩辕镜像 官方专业版
轩辕镜像
专业版
首页个人中心搜索镜像
交易
充值流量¥8起我的订单
文档
工具
提交工单页面收录
nginx

wayofdev/nginx

wayofdev

用于PHP开发的Nginx Docker镜像,支持SSL,基于轻量级Alpine,具备多架构支持。

下载次数: 0状态:社区镜像维护者:wayofdev仓库类型:镜像最近更新:4 天前
让 AI 帮你使用轩辕镜像? · 展开查看说明 · 点击收起说明

如果你使用 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 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。

DockerHub 官方简介
轩辕镜像中文简介
下载命令
镜像标签列表与下载命令
轩辕镜像,快一点,稳很多。
点击查看


    </picture>
</a>
<br>

https://github.com/wayofdev/docker-nginx/tags https://hub.docker.com/repository/docker/wayofdev/nginx


Docker Image: Nginx

This Docker image provides a streamlined Nginx setup optimized for local PHP development environments.

It's designed to seamlessly integrate with https://github.com/wayofdev/docker-php-dev and other (WOD) images, creating an efficient local development ecosystem for web projects.


🌟 Why Choose This Image for Local Development?

  • Ansible-based Configuration: Easily customizable through Ansible templates
  • PHP-FPM Optimized: Pre-configured to work with PHP-FPM for fast local testing and development
  • SSL Ready: Includes built-in support for HTTPS using self-signed certificates, mimicking production environments locally
  • Developer Friendly: Packed with tools and configurations to enhance local development workflows
  • Flexible Deployment: Includes a k8s-alpine variant for testing Kubernetes setups locally
  • Lightweight: Based on Alpine Linux for minimal footprint and faster local builds
  • Multi-arch Support: Works on both x86 (AMD64) and ARM64 architectures, supporting various development machines
  • Regular Updates: Maintained and updated frequently to align with the latest development practices

Perfect for developing Laravel applications, Symfony projects, or any PHP-based web services in a local environment that closely mirrors production setups.

Provides foundation for creating, testing, and debugging your web applications locally.


If you like/use this package, please *** ⭐️ starring it. Thanks!


📦 Image Variants

VariantDescription
dev-alpineFor local development environments, uses 80 and 443 ports.
k8s-alpineOptimized for k8s and local environments, uses 8880 and 8443 ports, rootless.

🚀 Usage

→ Pulling the Image

bash
docker pull wayofdev/nginx:k8s-alpine-latest

Replace k8s-alpine-latest with your desired type, and tag.

→ Available Image Variants

  • Types: k8s, dev
  • Architectures: amd64, arm64

→ Using in Docker Compose

Here's an example docker-compose.yml for a typical setup:

yaml
services:
  app:
    image: wayofdev/php-dev:8.3-fpm-alpine-latest
    container_name: ${COMPOSE_PROJECT_NAME}-app
    restart: on-failure
    networks:
      - default
      - shared
    depends_on:
      - database
    links:
      - database
    volumes:
      - ./.github/assets:/assets:rw,cached
      - ./app:/app:rw,cached
      - ./.env:/app/.env
      - ~/.composer:/.composer
      - ~/.ssh:/home/www-data/.ssh
    environment:
      FAKETIME: '+2h'
      XDEBUG_MODE: '${XDEBUG_MODE:-off}'
      PHIVE_HOME: /app/.phive
    dns:
      - 8.8.8.8
    extra_hosts:
      - 'host.docker.internal:host-gateway'

  web:
    image: wayofdev/nginx:k8s-alpine-latest
    container_name: ${COMPOSE_PROJECT_NAME}-web
    restart: on-failure
    networks:
      - default
      - shared
    depends_on:
      - app
    links:
      - app
    volumes:
      - ./app:/app:rw,cached
      - ./.env:/app/.env
    labels:
      - traefik.enable=true
      - traefik.http.routers.api-${COMPOSE_PROJECT_NAME}-secure.rule=Host(`api.${COMPOSE_PROJECT_NAME}.docker`)
      - traefik.http.routers.api-${COMPOSE_PROJECT_NAME}-secure.entrypoints=websecure
      - traefik.http.routers.api-${COMPOSE_PROJECT_NAME}-secure.tls=true
      - traefik.http.services.api-${COMPOSE_PROJECT_NAME}-secure.loadbalancer.server.port=8880
      - traefik.docker.network=network.${SHARED_SERVICES_NAMESPACE}

This configuration includes

  • An app service using the wayofdev/php-dev image for PHP processing.
  • A web service using a https://github.com/wayofdev/docker-nginx for serving the application.
  • Network configuration for both default and shared networks.
  • Volume mounts for application code, assets, and configuration files.
  • Environment variables for PHP and Xdebug configuration.
  • Traefik labels for reverse proxy and SSL termination.

Real-world Example

For a comprehensive, real-world example of how to use this image in a Docker Compose setup, please refer to the https://github.com/wayofdev/laravel-starter-tpl repository. This template provides a fully configured development environment for Laravel projects using the wayofdev/php-dev image.


⚙️ Configuration

The Nginx image is pre-configured for optimal performance with PHP applications, but you can customize it further to suit your specific needs.

→ Default Configuration

The default configuration is generated using Ansible templates and includes:

  • Optimized settings for PHP-FPM
  • SSL/TLS support with self-signed certificates
  • Gzip compression enabled
  • Basic security headers

→ Custom Configuration

While the configuration is primarily managed through Ansible templates, you can override specific settings:

  1. Environment Variables: The image uses the following environment variables:

    VariableDefault ValueDescription
    PHP_UPSTREAM_CONTAINERappThe name of the PHP-FPM container
    PHP_UPSTREAM_PORT9000The port of the PHP-FPM container

    Set these in your docker-compose.yml file:

    yaml
    services:
      web:
        image: wayofdev/nginx:k8s-alpine-latest
        environment:
          - PHP_UPSTREAM_CONTAINER=my-php-app
          - PHP_UPSTREAM_PORT=9001
    
  2. Volume Mounts: For more extensive customizations, you can mount your own config files:

    yaml
    services:
      web:
        image: wayofdev/nginx:k8s-alpine-latest
        volumes:
          - ./custom-nginx.conf:/etc/nginx/nginx.conf
          - ./custom-default.conf:/etc/nginx/conf.d/default.conf
    

→ SSL Configuration

The image includes self-signed SSL certificates. To use your own:

yaml
services:
  web:
    image: wayofdev/nginx:k8s-alpine-latest
    volumes:
      - ./certs/cert.pem:/etc/nginx/ssl/cert.pem
      - ./certs/key.pem:/etc/nginx/ssl/key.pem

→ Advanced Configuration

For more advanced configurations:

  1. Fork this repository
  2. Modify the Ansible templates in the src directory
  3. Regenerate the Dockerfiles using make generate
  4. Build your custom image

🔨 Development

This project uses a set of tools for development and testing. The Makefile provides various commands to streamline the development process.

→ Requirements

  • Docker
  • Make
  • Ansible
  • goss and dgoss for testing

→ Setting Up the Development Environment

Clone the repository:

bash
git clone git@github.com:wayofdev/docker-nginx.git && \
cd docker-nginx

→ Generating Dockerfiles

Ansible is used to generate Dockerfiles and configurations. To generate distributable Dockerfiles from Jinja template source code:

bash
make generate

→ Building Images

  • Build the default image:

    bash
    make build
    

    This command builds the image specified by the IMAGE_TEMPLATE variable in the Makefile. By default, it's set to k8s-alpine.

  • Build a specific image:

    bash
    make build IMAGE_TEMPLATE="k8s-alpine"
    

    Replace 8.3-fpm-alpine with your desired PHP version, type, and OS.

  • Build all images:

    bash
    make build IMAGE_TEMPLATE="k8s-alpine"
    make build IMAGE_TEMPLATE="dev-alpine"
    

    These commands will build all supported image variants.


🧪 Testing

This project uses a testing approach to ensure the quality and functionality of the Docker images. The primary testing tool is https://github.com/aelsabbahy/goss/tree/master/extras/dgoss, which allows for testing Docker containers.

→ Running Tests

You can run tests using the following commands:

  • Test the default image:

    bash
    make test
    

    This command tests the image specified by the IMAGE_TEMPLATE variable in the Makefile (default is k8s-alpine).

  • Test a specific image:

    bash
    make test IMAGE_TEMPLATE="k8s-alpine"
    

    Replace k8s-alpine with your desired image type, and OS.

  • Test all images:

    bash
    make test IMAGE_TEMPLATE="k8s-alpine"
    make test IMAGE_TEMPLATE="dev-alpine"
    

→ Test Configuration

The test configurations are defined in goss.yaml files, which are generated for each image variant. These files specify the tests to be run, including:

  • File existence and permissions
  • Process checks
  • Port availability
  • Package installations
  • Command outputs

→ Test Process

When you run the make test command, the following steps occur:

  1. The specified Docker image is built (if not already present).
  2. dgoss runs the tests defined in the goss.yaml file against the Docker container.
  3. The test results are displayed in the console.

🔒 Security Policy

This project has a security policy.


🙌 Want to Contribute?

Thank you for ***ing contributing to the wayofdev community! We are open to all kinds of contributions. If you want to:

  • 🤔 https://github.com/wayofdev/docker-nginx/issues/new?assignees=&labels=type%3A+enhancement&projects=&template=2-feature-request.yml&title=[Feature]%3A+
  • 🐛 https://github.com/wayofdev/docker-nginx/issues/new?assignees=&labels=type%3A+documentation%2Ctype%3A+maintenance&projects=&template=1-bug-report.yml&title=[Bug]%3A+
  • 📖 https://github.com/wayofdev/docker-nginx/issues/new?assignees=&labels=type%3A+documentation%2Ctype%3A+maintenance&projects=&template=4-docs-bug-report.yml&title=[Docs]%3A+
  • 👨‍💻 Contribute to the code

You are more than welcome. Before contributing, kindly check our contribution guidelines.


🫡 Contributors

https://github.com/wayofdev/docker-nginx/graphs/contributors

🌐 Social Links

  • ***: Follow our organization @wayofdev and the author @wlotyp.
  • ***: Join our community on ***.

⚖️ License


镜像拉取方式

您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。

轩辕镜像加速拉取命令点我查看更多 nginx 镜像标签

docker pull docker.xuanyuan.run/wayofdev/nginx:<标签>

使用方法:

  • 登录认证方式
  • 免认证方式

DockerHub 原生拉取命令

docker pull wayofdev/nginx:<标签>

轩辕镜像配置手册

按平台快速找到配置文档

一键安装

一键安装 Docker

Linux Docker 一键安装

AI

用 AI 使用轩辕镜像

agents.md · AI 对话 · 提示词

Docker

登录仓库拉取

登录认证 · 私有仓库

专属域名拉取

免登录 · 高速拉取

Linux

Docker 镜像配置

Windows / Mac

Docker Desktop 配置

MacOS OrbStack

OrbStack 容器

Apple Container

macOS 原生容器

Docker Compose

Compose 项目配置

NAS

群晖

Synology 配置

飞牛

fnOS 镜像配置

绿联

绿联 NAS

威联通

QNAP 配置

极空间

极空间 NAS

Unraid

Unraid NAS

企业仓库

其他仓库

ghcr · Quay · nvcr

Harbor 镜像源

Proxy Repository 对接

Portainer 镜像源

Registries 配置

Nexus 镜像源

Docker Proxy 缓存

开发工具

Dev Containers

VS Code 开发容器

Podman

Podman 配置指南

Singularity / Apptainer

HPC 科学计算容器

Kubernetes

K8s Containerd

Kubernetes · Containerd

K3s

轻量级集群

面板 / 网络

爱快路由

爱快 4.0 · iKuai 镜像加速

宝塔面板

一键配置镜像源

需要其他帮助?请查看我们的 常见问题Docker 镜像访问常见问题解答 或 提交工单

镜像拉取常见问题

功能

版本功能对比

功能对比 · 版本选择

支持的镜像仓库

Docker Hub · GCR · GHCR

专属域名用法

专属域名 · 开启停用 · 多仓库

新手拉取配置

登录 · 专属域名 · 配置

docker search 限制

专属域名 · Hub 搜索

不支持 push

仅支持 pull · 不支持

拉取速度原因

带宽 · 缓存 · 冷热镜像

错误码

402 与流量用尽

402 · 流量包 · 充值

401 认证失败

401 · docker login

manifest unknown

标签错误 · 镜像不存在

410 Gone 排查

410 · Docker 升级

429 限流

免费版 · 专业版 · 企业版 · 请求频率

其他报错

DNS 超时

DNS 解析 · 网络超时

TLS 证书失败

no matching manifest(架构)

docker.sock / daemon

账号

失败是否计费

manifest · blob · 计费

申请开票(企业 / 个人)

开票 · 发票 · 工单

修改登录密码

网站 · 仓库 · 重置

注销账户

工单 · 数据 · 注销

原理

mirrors 不生效

daemon.json · 重启

去掉域名前缀

docker tag · 重命名

指定架构拉取

ARM64 · AMD64 · 多架构

latest 与「最新」

digest · 版本号 · 标签

查看全部问题→

用户好评

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

用户头像

oldzhang

运维工程师

Linux服务器

5

"Docker访问体验非常流畅,大镜像也能快速完成下载。"

轩辕镜像
镜像详情
...
wayofdev/nginx
定价查看流量套餐与价格
博客Docker 镜像公告与技术博客
专业版 · 高速稳定拉取镜像
高速镜像下载·在线技术支持·99.95% SLA 保障·付费会员免广告
50GB 仅 ¥8/年
专业版 · 高速稳定拉取镜像
50GB 仅 ¥8/年
高速镜像下载·在线技术支持·99.95% SLA 保障·付费会员免广告
用户协议·隐私政策·增值电信业务经营许可证:浙B2-20261007·©2024-2026 源码跳动©2024-2026 杭州源码跳动科技有限公司·商务合作:点击复制邮箱

更多 nginx 镜像推荐

nginx logo

library/nginx

Docker 官方镜像
Nginx 官方 Docker 镜像,提供高性能 Web 服务器和反向代理能力,适合部署静态站点、反向代理和负载均衡入口,可通过挂载配置和静态目录快速搭建统一的 Web 与 API 网关层。
2.1万 次收藏10亿+ 次下载
5 天前更新
nginx/nginx-ingress logo

nginx/nginx-ingress

NGINX 官方镜像
NGINX和NGINX Plus入口控制器是专为Kubernetes设计的流量管理工具,主要用于管理外部HTTP/HTTPS流量进入Kubernetes集群,支持请求路由、负载均衡、SSL终止、流量控制等功能,适用于容器化应用和微服务架构,其中NGINX Plus还提供商业支持、高级监控和增强的负载均衡能力,帮助提升集群流量管理的效率与安全性。
122 次收藏10亿+ 次下载
3 天前更新
nginx/nginx-prometheus-exporter logo

nginx/nginx-prometheus-exporter

NGINX 官方镜像
NGINX Prometheus Exporter用于收集并导出NGINX与NGINX Plus的监控指标,供Prometheus采集以实现对其运行状态的监控。
52 次收藏5000万+ 次下载
19 天前更新
nginx/nginx-ingress-operator logo

nginx/nginx-ingress-operator

NGINX 官方镜像
用于NGINX和NGINX Plus入口控制器的NGINX入口操作器,基于Helm图表构建。
4 次收藏100万+ 次下载
11 天前更新
NGINX Development Center logo

extension/nginx

extension
NGINX Development Center for Docker Desktop
5万+ 次下载
3 年前更新
bitnamicharts/nginx logo

bitnamicharts/nginx

bitnamicharts
Bitnami提供的Helm图表,用于在Kubernetes环境中部署和管理NGINX Open Source开源Web服务器及反向代理。
4 次收藏1000万+ 次下载
11 天前更新

查看更多 nginx 相关镜像

更多相关 Docker 镜像与资源

以下是 wayofdev/nginx 相关的常用 Docker 镜像,适用于 反向代理、负载均衡、静态资源服务 等不同场景:

  • library/nginx Docker 镜像说明
  • ilios/nginx Docker 镜像说明(Nginx Web 服务器,轻量高效)
  • ubuntu/nginx Docker 镜像说明(Nginx Web 服务器,基于 Ubuntu,适合生产环境)
  • bitnami/nginx Docker 镜像说明(Nginx Web 服务器,Bitnami 企业级配置,适合生产环境)
  • linuxserver/nginx Docker 镜像说明(Nginx Web 服务器,LinuxServer 维护版本,适合静态资源服务和反向代理)