drop.a-hxin.cn/README.md
2025-04-10 22:57:25 +08:00

40 lines
1.0 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# drop.a-hxin.cn
一个局域网传输网站原地址github.com/SnapDrop
# Snapdrop 局域网分享网站搭建
## 下载安装
github 链接https://github.com/A-hxin/snapdrop
gitea 私有仓库https://git.a-hxin.cn/ahxin/drop.a-hxin.cn.git
### 后端部署
- 切换至目录 `/server/`使用 `npm i` 安装环境包;
- 使用 `node index.js` 运行后端项目
### 前端部署
- 将目录 `/client/`上传至服务器,并建立 PHP 服务;
- 下面反代理一定要设置否则无法连接后端 `api`
**重点,反代理**
```css
location / {
root /www/wwwroot/drop.a-hxin.cn/client;
index index.html index.htm;
}
location /server {
proxy_connect_timeout 300;
proxy_pass http://127.0.0.1:3000;
proxy_set_header Connection "upgrade";
proxy_set_header Upgrade $http_upgrade;
proxy_set_header X-Forwarded-for $remote_addr;
}
```
### 开放端口
默认后端端口是 `3000`,如要修改则在 `/server/index.js`中修改;