docker安装nginx proxy manager 的配置和使用,一键配置反向代理,重写向,ssl,nginx认证,404等。

一,先安装docker和docker-compose的环境。

docker镜像的安装

英文镜像—— jc21/nginx-proxy-manager

中文镜像——chishin/nginx-proxy-manager-zh

nginx proxy manager 官网

二,安装nginx proxy manager

在docker中创建一个文件夹,有后面有利于迁移和备份。

mkdir -p docker/data/文件名
  1. 进入目录中,创建个docker-compose.yaml

version: '3.8'
services:
  app:
    image: 'jc21/nginx-proxy-manager:latest'    可以改成中文的镜像
    restart: unless-stopped
    ports:
      # These ports are in format <host-port>:<container-port>
      - '80:80' # Public HTTP Port
      - '443:443' # Public HTTPS Port
      - '81:81' # Admin Web Port
      # Add any other Stream port you want to expose
      # - '21:21' # FTP

    # Uncomment the next line if you uncomment anything in the section
    # environment:
      # Uncomment this if you want to change the location of
      # the SQLite DB file within the container
      # DB_SQLITE_FILE: "/data/database.sqlite"

      # Uncomment this if IPv6 is not enabled on your host
      # DISABLE_IPV6: 'true'

    volumes:
      - ./data:/data
      - ./letsencrypt:/etc/letsencrypt

2.执行docker-compose up -d

screenshot-npm.oppoybfq.com-2023.11.10-20_16_35.png