安装

1
2
3
# 下面需要代理
wget https://code-server.dev/install.sh
sh ./install.sh
1
vi ~/.config/code-server/config.yaml
1
2
3
4
bind-addr: 127.0.0.1:8098  # 改成空端口
auth: password # 验证方式不要动
password: 1a980e9 # 改成自己密码
cert: false
1
2
code-server # 启动
# 也可以添加到守护进程或者开机自启动

配置

反向代理配置参考,不这么设置可能出现登陆成功验证失败,一直让刷新

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#PROXY-START/
location ~* \.(gif|png|jpg|css|js|woff|woff2)$
{
proxy_pass http://127.0.0.1:8098;
proxy_set_header Host $host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection upgrade;
proxy_set_header Accept-Encoding gzip;
expires 12h;
}
location /
{
proxy_pass http://127.0.0.1:8098;
proxy_set_header Host $host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection upgrade;
proxy_set_header Accept-Encoding gzip;
}

#PROXY-END/

登陆