惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
H
Hacker News: Front Page
P
Palo Alto Networks Blog
T
ThreatConnect
Apple Machine Learning Research
Apple Machine Learning Research
博客园_首页
T
True Tiger Recordings
P
Privacy & Cybersecurity Law Blog
B
Blog
IT之家
IT之家
Last Week in AI
Last Week in AI
F
Full Disclosure
Hacker News: Ask HN
Hacker News: Ask HN
C
Comments on: Blog
Microsoft Azure Blog
Microsoft Azure Blog
C
Cybersecurity and Infrastructure Security Agency CISA
Microsoft Security Blog
Microsoft Security Blog
博客园 - 【当耐特】
N
News and Events Feed by Topic
NISL@THU
NISL@THU
腾讯CDC
雷峰网
雷峰网
Security Latest
Security Latest
李成银的技术随笔
M
Microsoft Research Blog - Microsoft Research
L
LangChain Blog
L
Lohrmann on Cybersecurity
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
C
Check Point Blog
Y
Y Combinator Blog
Recent Announcements
Recent Announcements
博客园 - Franky
N
News | PayPal Newsroom
V
V2EX
A
About on SuperTechFans
The Register - Security
The Register - Security
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Google Online Security Blog
Google Online Security Blog
MyScale Blog
MyScale Blog
Cisco Talos Blog
Cisco Talos Blog
Vercel News
Vercel News
WordPress大学
WordPress大学
C
Cyber Attacks, Cyber Crime and Cyber Security
The Hacker News
The Hacker News
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
爱范儿
爱范儿
A
Arctic Wolf
L
LINUX DO - 最新话题
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More

Bluemangoo's Blog

看一点答辩Issue Python 语言基础 Vercel 折腾笔记 建站一周年纪念! Bing Points 辅助工具 白象过湾 Windows 10 触摸键盘大小调整 尘烟 One一个 文章推荐 内存填充器 Markdown 加载器 力扣 0899 - 有序队列 【芒果快评】安倍晋三遭枪击 常用软件下载链接 那些震惊了我的文案(持续更新) 一个抛鸡蛋的小游戏 《1984》书评 Explorer Patcher 推荐 英语书也会出错啊 图片转Python的turtle库代码 Phigros电脑版 Windows 11 子系统(WSA)安装方法
在 Vercel 上部署 MCSManager 的 UI 项目
2023-07-29 · via Bluemangoo's Blog

搭建MCSManger的时候,大部分人会选择Frp将本地面板开发到云端。但是这样访问会很慢。

这时候你有几种解决办法:

  • 用cdn: (推荐使用Cloudflare加速您的网站.jpg)
  • 换一家frp提供商: (富哥v我50)
  • 换vps: (富哥v我台机子)
  • 采用Vercel来提供静态资源

本文重点讲解最后一种方案。

前提条件

  1. 你有一个Github账号
  2. 你有一个Vercel账号
  3. 你有一个域名

(嗯其实其它git服务都可以,就是Github方便)

域名的问题解释一下,vercel提供的域名*.vercel.app在中国大陆处于被DNS污染的状态,你不能用,但是自己绑定域名就可以。

本方案适用于以下人群:

  • 没有技术力
  • 不希望暴露源站
  • 源站没有ssl(https)

将MCSManager的官方包下载,把web/public文件夹拷出来。

新建一个Github仓库,把public文件夹放进去,再新建一个vercel.json文件。

填入以下内容:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{
"builds": [
{
"src": "/**/*",
"use": "@vercel/static"
}
],
"rewrites": [
{
"source": "/:match*",
"destination": "$YOUR_WEB_URL/:match*"
},
{
"source": "/:match*/",
"destination": "$YOUR_WEB_URL/:match*/"
}
],
"github": {
"silent": true
}
}

将其中的$YOUR_WEB_URL换成你web端的url (e.g.https://mcsm.foo.bar),然后提交推送。

关于vercel.json的详细信息可以看官方文档

然后在vercel选择Add new - Project,导入你前面写完的那个git仓库。

导入完成后你可以找得到这个项目。在项目设置中找到域名,添加你自己的域名,按照提示操作就行了。

最后,访问你的你的站点,检查是否可以正常运行。

部署UI+308重定向

本方案适用于以下人群:

  • 没有技术力
  • 追求快一点点的速度

本方案的要求:

  • 源站有ssl

特别需要注意的是,本方案会暴露源站。

方案和反代的方案类似,唯一的区别是vercel.json:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{
"builds": [
{
"src": "/**/*",
"use": "@vercel/static"
}
],
"redirects": [
{
"source": "/:match*",
"destination": "$YOUR_WEB_URL/:match*"
},
{
"source": "/:match*/",
"destination": "$YOUR_WEB_URL/:match*/"
}
],
"github": {
"silent": true
}
}

可以看到rewrites被换成了redirects

剩下的都相同。