You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
68 lines
1.7 KiB
68 lines
1.7 KiB
9 months ago
|
---
|
||
|
title: NAS中安装npm
|
||
|
tags:
|
||
|
- docker
|
||
|
- NAS技术
|
||
|
- 反向代理
|
||
8 months ago
|
categories: NAS技术
|
||
9 months ago
|
description: NAS中安装nginx proxy manager作反向代理
|
||
|
abbrlink: 4049218885
|
||
|
date: 2024-02-28 11:02:22
|
||
|
keywords:
|
||
|
---
|
||
|
# 安装NPM
|
||
|
|
||
|
>npm是nginx proxy manager的简称,如果在nas里的服务很少用docker安装的话,推荐使用它来进行反向代理。这里我介绍下具体的安装和使用方法。
|
||
|
|
||
|
在nas上合适的位置创建目录,并创建如下文件。
|
||
|
|
||
|
<img src="https://img.dreamlyn.cn:8443/i/2024/02/26/125212.webp">
|
||
|
|
||
|
其中docker-compose文件如下:
|
||
|
|
||
|
```
|
||
|
version: '3'
|
||
|
services:
|
||
|
app:
|
||
|
image: 'jc21/nginx-proxy-manager:latest'
|
||
|
restart: unless-stopped
|
||
|
ports:
|
||
|
- '680:80'
|
||
|
- '681:81'
|
||
|
- '6443:443'
|
||
|
volumes:
|
||
|
- ./data:/data # 把数据存放在在当前文件夹下的 data 文件夹中
|
||
|
- ./letsencrypt:/etc/letsencrypt
|
||
|
networks:
|
||
|
default:
|
||
|
external:
|
||
|
name: docker_default
|
||
|
```
|
||
|
|
||
|
然后在npm目录下执行如下命令:
|
||
|
```
|
||
|
# 创建docker网络,如果已经有docker_default网络,则不需要。
|
||
|
docker network create -d bridge --attachable=true docker_default
|
||
|
# 启动npm
|
||
|
docker-compose up -d
|
||
|
# 查看启动日志
|
||
|
docker-compose logs -f
|
||
|
```
|
||
|
没有问题的话,就可以通过192.168.31.206:681来进入npm的管理界面。
|
||
|
|
||
|
登陆的初始账号密码是admin@example.com和changeme。
|
||
|
|
||
|
我们输入正确的账号密码登录。
|
||
|
|
||
|
首次登陆会提示我们修改账号密码,我们根据自己的情况修改下。
|
||
|
|
||
|
# 配置Let’s Encrypt
|
||
|
|
||
|
以DNSPod为例介绍
|
||
|
|
||
|
<img src="https://img.dreamlyn.cn:8443/i/2024/02/28/091941.webp">
|
||
|
|
||
|
<img src="https://img.dreamlyn.cn:8443/i/2024/02/28/092012.webp">
|
||
|
|
||
|
其中第二张图片的id和token需要再dnspod的后台获取。
|