×

配置云端VSCode 配置在线VSCode云服务器

云服务器搭建VSCode云端在线版编辑器

mtsym mtsym 发表于2020-03-15 21:04:01 浏览4330 评论0

抢沙发发表评论

个人常用的电脑好几个,有时候做开发切换环境真的很麻烦,因此我之前搭建了好几个云端编辑器做服务端之类的开发,包括webide、eclipse che这些,鉴于eclipse che太吃资源,最新版本限制太多,我又回到了基于VSCode的code-server,这次用的是腾讯云给开发者的优惠云服务器,之前搭建Eclipse Che用的是自己淘汰的笔记本电脑,为了方便访问我配置了域名及https,因为不用ssl一些功能会受影响。

云服务器点击前往腾讯云开发者服务器

点击前往Code-Server

大致步骤如下:

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;
    }

群贤毕至

访客