个人常用的电脑好几个,有时候做开发切换环境真的很麻烦,因此我之前搭建了好几个云端编辑器做服务端之类的开发,包括webide、eclipse che这些,鉴于eclipse che太吃资源,最新版本限制太多,我又回到了基于VSCode的code-server,这次用的是腾讯云给开发者的优惠云服务器,之前搭建Eclipse Che用的是自己淘汰的笔记本电脑,为了方便访问我配置了域名及https,因为不用ssl一些功能会受影响。
大致步骤如下:
1. 下载code-server的Linux版本或者用docker搭建,具体看官方文档
2. 使用nginx配置端口转发
3. 使用Let's encrypt配置https证书
nginx配置如下,转发8080端口
server
{
listen 443 ssl http2;
#listen [::]:443 ssl http2;
server_name code.11000011.com ;
.......
location / {
proxy_pass http://127.0.0.1:8080;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection upgrade;
proxy_set_header Accept-Encoding gzip;
}
access_log /home/wwwlogs/code.11000011.com.log;
}
我要评论