官方网址:https://nginxproxymanager.com/
汉化:https://github.com/xiaoxinpro/nginx-proxy-manager-zh
该项目作为预构建的 docker 镜像提供,使您能够轻松转发到您在家中或其他地方运行的网站,包括免费 SSL,而无需了解太多有关 Nginx 或 Letsencrypt 的信息。
安装 Docker 和 Docker-Compose
创建一个docker-compose.yml文件:
version: "3"
services:
app:
image: 'hczjl/npm:2.9.19'
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
然后:
docker-compose up -d
如果您选择 MySQL 配置,则必须自己提供数据库服务器。您也可以使用 MariaDB。以下是最低支持版本:
也很容易为您的数据库使用另一个 docker 容器并将其链接为 docker 堆栈的一部分,因此这就是以下示例将要使用的内容。
docker-compose.yml以下是使用 MariaDB 容器时的示例:
version: "3"
services:
npm:
image: 'hczjl/npm:2.9.19'
container_name: npm_server
restart: always
depends_on:
- npm_db
networks:
network:
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
environment:
DB_MYSQL_HOST: "npm_db"
DB_MYSQL_PORT: 3306
DB_MYSQL_USER: "npm"
DB_MYSQL_PASSWORD: "npm@A"
DB_MYSQL_NAME: "npm"
# Uncomment this if IPv6 is not enabled on your host
# DISABLE_IPV6: 'true'
volumes:
- ./data:/data
- ./letsencrypt:/etc/letsencrypt
npm_db:
image: 'hczjl/mariadb:10.4.15'
container_name: npm_db
restart: always
networks:
network:
environment:
MYSQL_ROOT_PASSWORD: 'npm@A'
MYSQL_DATABASE: 'npm'
MYSQL_USER: 'npm'
MYSQL_PASSWORD: 'npm@A'
volumes:
- ./data/mysql:/var/lib/mysql
networks:
network:
请注意,DB_MYSQL_环境变量将优先于DB_SQLITE_变量。所以如果你保留 MySQL 变量,你将无法使用 SQLite。
应用程序首次运行后,将发生以下情况:
此过程可能需要几分钟,具体取决于您的机器。
Email: [email protected]
Password: changeme
使用此默认用户登录后,系统会立即要求您修改详细信息并更改密码。
如果您是更高级的用户,您可能渴望获得额外的 Nginx 可定制性。
NPM 能够在不同的地方包含不同的自定义配置片段。
您可以在以下位置添加自定义配置片段文件/data/nginx/custom:
/data/nginx/custom/root.conf:包含在 nginx.conf 的最后/data/nginx/custom/http_top.conf: 包含在主 http 块的顶部/data/nginx/custom/http.conf: 包含在主 http 块的末尾/data/nginx/custom/stream.conf: 包含在主流块的末尾/data/nginx/custom/server_proxy.conf:包含在每个代理服务器块的末尾/data/nginx/custom/server_redirect.conf:包含在每个重定向服务器块的末尾/data/nginx/custom/server_stream.conf:包含在每个流服务器块的末尾/data/nginx/custom/server_stream_tcp.conf: 包含在每个 TCP 流服务器块的末尾/data/nginx/custom/server_stream_udp.conf: 包含在每个 UDP 流服务器块的末尾Content type
Image
Digest
sha256:e5cc396e6…
Size
320.2 MB
Last updated
over 3 years ago
docker pull hczjl/npm:2.9.19