Skip to content

Latest commit

 

History

History

nginx

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Nginx

Docker Tags Image Size Docker Stars Docker Pulls

A nginx docker image with secure configurations and some useful modules, such as ngx_http_geoip_module, ngx_http_image_filter_module, ngx_http_perl_module, ngx_http_xslt_filter_module, ngx_mail_module, ngx_stream_geoip_module, ngx_stream_module, ngx-fancyindex, headers-more-nginx-module, etc.

Build with the linux/arm64, linux/386, linux/amd64, linux/arm/v6, linux/arm/v7, linux/arm64/v8 architectures.

Already installed modules:

More modules can be found in Dockerfile.

Pull

docker pull funnyzak/nginx:latest
# GHCR
docker pull ghcr.io/funnyzak/nginx:latest
# Aliyun
docker pull registry.cn-beijing.aliyuncs.com/funnyzak/nginx:latest

Usage

Docker Run

First, create a nginx.conf file in your project directory, and then run the following command:

# Run nginx container with default settings
docker run -d -t -i --name nginx --restart on-failure \
  -p 1697:80 \
  funnyzak/nginx

# Run nginx container with custom configuration directory
docker run -d -t -i --name nginx2 --restart on-failure \
  -v ./nginx/conf.d:/etc/nginx/conf.d \
  -p 1688:80 \
  funnyzak/nginx

# Run nginx container with custom HTML directory
docker run -d -t -i --name nginx3 --restart on-failure \
  -v ./nginx/html:/etc/nginx/html \
  -p 1690:80 \
  funnyzak/nginx

Docker Compose

First, create a docker-compose.yml file in your project directory:

version: “3.3”
services:
  nginx:
    image: funnyzak/nginx
    container_name: nginx
    environment:
      - TZ=Asia/Shanghai
    volumes:
      - ./nginx/conf.d:/etc/nginx/conf.d
    restart: on-failure
    ports:
      - “1688:80” 

Then, run the following command:

docker-compose up -d

Docker Build

docker build \
--build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
--build-arg VERSION="1.27.3"
-t funnyzak/nginx:1.27.3 .

Reference