为ipv6 only vps配置web ssh
下载ttyd
wget -O ttyd https://github.com/tsl0922/ttyd/releases/download/1.6.3/ttyd.x86_64
chmod +x ttyd
mv ttyd /usr/sbin
配置开机自启动服务,编辑/etc/systemd/system/ttyd.service,填入(其中ktsee:ktsee为用户名和密码)[Unit]
Description=ttyd
After=network.target
[Service]
ExecStart=/usr/sbin/ttyd -c ktsee:ktsee bash
[Install]
WantedBy=multi-user.target
设置开机自启动systemctl start ttyd
systemctl enable ttyd
配置nginxlocation ~ ^/ttyd(.*)$ {
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_pass http://127.0.0.1:7681/$1;
}
评论