chore: 默认端口改为 3030
- 更新 .env, .env.example, .env.production - 避免与 3000 端口冲突
This commit is contained in:
39
NGINX.md
39
NGINX.md
@@ -1,5 +1,14 @@
|
||||
# Nginx 部署指南
|
||||
|
||||
## 🎯 特点
|
||||
|
||||
- ✅ **不占用 80/443 端口** - Node.js 应用运行在 3000 端口
|
||||
- ✅ **多域名支持** - 可与其他应用共享 Nginx
|
||||
- ✅ **反向代理** - 飞书回调通过 Nginx 转发到应用
|
||||
- ✅ **HTTPS 支持** - 可选配置 SSL 证书
|
||||
|
||||
---
|
||||
|
||||
## 📋 完整部署流程
|
||||
|
||||
### 1️⃣ 准备服务器
|
||||
@@ -114,10 +123,12 @@ sudo nano /etc/nginx/sites-available/qiniu-bot
|
||||
|
||||
**配置内容:**
|
||||
|
||||
### 方式一:独立域名(推荐)
|
||||
|
||||
```nginx
|
||||
server {
|
||||
listen 80;
|
||||
server_name your-domain.com; # 替换为你的域名或服务器 IP
|
||||
server_name qiniu.your-domain.com; # 替换为你的域名
|
||||
|
||||
# 日志
|
||||
access_log /var/log/nginx/qiniu-bot-access.log;
|
||||
@@ -153,6 +164,32 @@ server {
|
||||
}
|
||||
```
|
||||
|
||||
### 方式二:子路径(与其他应用共享域名)
|
||||
|
||||
```nginx
|
||||
server {
|
||||
listen 80;
|
||||
server_name your-domain.com;
|
||||
|
||||
# 七牛云上传机器人(子路径)
|
||||
location /qiniu/feishu/event {
|
||||
proxy_pass http://127.0.0.1:3000/feishu/event;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Feishu-Request-Timestamp $http_x_feishu_request_timestamp;
|
||||
proxy_set_header X-Feishu-Request-Nonce $http_x_feishu_request_nonce;
|
||||
proxy_set_header X-Feishu-Request-Signature $http_x_feishu_request_signature;
|
||||
}
|
||||
|
||||
# 其他应用...
|
||||
location /other-app {
|
||||
proxy_pass http://127.0.0.1:4000;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
> **注意:** 如果使用子路径,需要在飞书开放平台配置请求地址为 `https://your-domain.com/qiniu/feishu/event`
|
||||
|
||||
### 启用配置
|
||||
|
||||
```bash
|
||||
|
||||
Reference in New Issue
Block a user