31 lines
1.5 KiB
Markdown
31 lines
1.5 KiB
Markdown
# Nginx Proxy Manager 配置说明
|
||
|
||
已在 [Nginx Proxy Manager](https://npm.yuxindazhineng.com/nginx/proxy) 配置域名和强制 HTTPS,对外统一用域名访问。
|
||
|
||
## 1. 在 NPM 中编辑该域名的 Proxy Host
|
||
|
||
- **Details**:域名填 **`yuheng.yuxindazhineng.com`**,**Forward Hostname / IP** 填本机 IP(如 `192.168.10.241`),**Forward Port** 填 **9528**(官网首页)。
|
||
- **SSL**:按需开启并强制 HTTPS。
|
||
|
||
## 2. Custom Locations(路径转发)
|
||
|
||
在 **Custom Locations** 中保证以下三条(端口与截图不一致的请改掉):
|
||
|
||
| Location | Scheme | Forward Hostname / IP | Forward Port | 说明 |
|
||
|----------|--------|------------------------|--------------|----------|
|
||
| `/` | `http` | `192.168.10.241` | **9528** | 官网首页 |
|
||
| `/admin` | `http` | `192.168.10.241` | **9529** | 管理后台(端口应为 9529,不是 9289) |
|
||
| `/api` | `http` | `192.168.10.241` | **9527** | 后端接口 |
|
||
|
||
- 若当前是 `/index` 指向 9528,建议改为 **`/`** 指向 **9528**,这样首页是 `https://域名/` 而不是 `https://域名/index`。
|
||
- `/admin` 的端口请确认为 **9529**(截图里 9289 易误,应为 9529)。
|
||
- 务必增加 **`/api` → 9527**,否则前后台请求接口会 404。
|
||
|
||
## 3. 访问方式(对外统一域名)
|
||
|
||
- 官网:**https://yuheng.yuxindazhineng.com/**
|
||
- 管理后台:**https://yuheng.yuxindazhineng.com/admin/**
|
||
- 接口:**https://yuheng.yuxindazhineng.com/api/...**
|
||
|
||
前后台与接口同域,无需再设 `VITE_API_BASE`。
|