要将 Nginx 配置为跳转到 Ttyd 服务上,可以按照以下步骤进行操作:

  1. 安装 Ttyd 服务,并确保它正在运行。

  2. 在 Nginx 配置文件中添加以下内容:

server {
    listen 80;
    server_name example.com;

    location /ttyd {
        proxy_pass http://127.0.0.1:7681/;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_read_timeout 86400;
    }
}
  1. 保存并重新加载 Nginx 配置文件。

  2. 现在,当用户访问 http://example.com/ttyd 时,Nginx 将会将请求转发到 Ttyd 服务上。

Nginx 配置跳转到 Ttyd 服务

原文地址: https://www.cveoy.top/t/topic/fVdL 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录