Sign inSign up

pengwz/nginx

By pengwz

•Updated 10 months ago

Supports production-grade stable Nginx images with multiple architectures.

Image
Web servers
0

1.7K

pengwz/nginx repository overview

⁠✨ Introduction

A custom-built Nginx 1.28.x image, integrated with QuicTLS and common modules, supporting HTTP/2, HTTP/3, TLS 1.3, and offering multi-architecture builds (amd64 / arm64).


⁠✨ Features

  • Based on Debian bookworm-slim for a minimal environment
  • Integrated QuicTLS (OpenSSL fork), supporting TLS 1.3 and QUIC
  • Enabled the following Nginx modules:
    • http_stub_status_module
    • http_ssl_module
    • stream
    • http_v2_module
    • http_v3_module
    • http_gzip_static_module
    • http_sub_module
    • Third-party module: ngx_http_substitutions_filter_module
  • Multi-stage build, slim runtime environment with only essential dependencies
  • Default support for Chinese and English locales (zh_CN.UTF-8, en_US.UTF-8)
  • Provides default homepage and favicon for immediate testing

⁠🚀 Usage

⁠Pull the Image

docker pull pengwz/nginx

⁠Run the Container

docker run -d \
  --name mynginx \
  -p 80:80 -p 443:443 -p 443:443/udp \
  pengwz/nginx

⁠Configuration Mounts

services:
  nginx:
    image: pengwz/nginx
    container_name: nginx
    restart: always
    # Default timezone is Asia/Shanghai
    # environment: 
    #   - TZ=Asia/Tokyo
    ports:
      - "80:80"
      - "443:443/udp" # QUIC/HTTP3 requires UDP 443
      - "443:443/tcp" # HTTPS/HTTP2
    volumes:
      # If you have a custom main config directory
      # - ./nginx.conf:/usr/local/nginx/conf/nginx.conf:rw
      # Sub config directory
      - ./conf.d:/usr/local/nginx/conf.d:rw
      # Static files directory
      - ./html:/usr/local/nginx/html:rw
      # SSL certificates
      - ./certs:/usr/local/nginx/certs:rw

⁠✨ Other Commands

# View logs
docker logs -f --tail 1 nginx
# Access the container
docker exec -it nginx /bin/bash

⁠🏗️ Build Instructions

The image uses multi-stage builds:

  1. Build Stage
    • Based on debian:bookworm-slim
    • Compile QuicTLS
    • Compile Nginx 1.28.x + modules
  2. Runtime Stage
    • Slim dependencies, only keeping the necessary libraries
    • Set the timezone to Asia/Shanghai
    • Default user: nginx
    • Default working directory: /usr/local/nginx

⁠📌 Multi-Architecture Support

  • linux/amd64
  • linux/arm64

⁠🔒 Port Details

  • 80 → HTTP
  • 443 → HTTPS (TCP)
  • 443/udp → QUIC/HTTP3

⁠🔍 Differences from Official Nginx Image

  • HTTP/3 Support: The official image does not enable HTTP/3 by default; this image has --with-http_v3_module compiled.
  • QuicTLS Integration: Uses QuicTLS instead of OpenSSL to enhance TLS 1.3 and QUIC support.
  • Extra Modules: Includes ngx_http_substitutions_filter_module for content substitution functionality.
  • Multi-language locales: Built-in Chinese and English UTF-8 locales.
  • Slim runtime environment: Multi-stage build makes the runtime image smaller and cleaner.

⁠📝 License

This image is based on the Nginx official open-source license and QuicTLS, suitable for both learning and production deployment.

Tag summary

Content type

Image

Digest

sha256:d2149217c…

Size

49.7 MB

Last updated

10 months ago

docker pull pengwz/nginx