Skip to content

通过配置多个代理节点来代理OneDrive下载的流量,可根据访问者的运营商来分配指定的下载节点

License

Notifications You must be signed in to change notification settings

XiYan233/OneDrive-Multi-Node-Proxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OneDrive多节点下载

Author Go

通过配置多个代理节点来代理OneDrive下载的流量,可根据访问者的运营商来分配指定的下载节点。

准备

  • 前往 Releases 下载最新文件
  • 解压最新压缩包

Docker compose 方式部署

Hub 地址

Linux方式部署

tar -zxvf onedrive-proxy-linux-amd64.tar.gz
  • 进入 onedrive-proxy-linux-amd64
cd onedrive-proxy-linux-amd64
  • 修改 config/config.json, cn_mobile -> 中国移动, cn_uni -> 中国联通, cn_tele -> 中国电信, other -> 其他
{
  "url_config": {
    "cn_mobile": {
      "url": "https://you.domain.com"
    },
    "cn_uni": {
      "url": "https://you.domain.com"
    },
    "cn_tele": {
      "url": "https://you.domain.com"
    },
    "other": {
      "url": "https://you.domain.com"
    }
  }
}
  • 运行 onedrive-proxy-linux-amd64,请确保 8080 端口没有被占用
./onedrive-proxy-linux-amd64

OneDrive反代教程

请不要在同一台机子上搭建,否则端口会有冲突

  • 安装 DockerDocker-Compose
# 安装Docker
curl -sSL https://get.docker.io | bash
# 安装Docker-Compose
curl -L "https://github.com/docker/compose/releases/download/v2.16.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose && chmod +x /usr/local/bin/docker-compose && ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
  • 安装 Nginx Proxy Manager
# 创建Nginx Proxy Manager文件夹
mkdir -p Nginx-Proxy-Manager
# 进入Nginx-Proxy-Manager文件夹
cd Nginx-Proxy-Manager
# 创建docker-compose.yml文件
touch docker-compose.yml

编辑 docker-compose.yml粘贴以下内容

version: '3'
services:
  app:
    image: 'jc21/nginx-proxy-manager:latest'
    restart: unless-stopped
    ports:
      - '80:80'
      - '81:81'
      - '443:443'
    volumes:
      - ./data:/data
      - ./letsencrypt:/etc/letsencrypt

启动容器

docker-compose up -d

启动成功后访问 http://IP:81进入Nginx Proxy Manager,默认用户名为 [email protected],密码为 changeme

创建反向代理(OneDrive/SharePoint),视情况而定

  • OneDrive反代配置
    • 进入后台后,点击菜单栏中的 Hosts -> Proxy Hosts -> Add Proxy Hosts
    • Domain Names填写你的域名、SchemehttpsForward Hostname / IP填写 改成你的-my.sharepoint.comForward Port填写443
    • SSL Certificate选择Request a new SSL Certifite,打开Force SSLHTTP/2 SupportI Agree to the ...的开关
    • Custom Nginx Configuration填写下面的配置,最后点击Save
      #PROXY-START/
      location  ~* \.(php|jsp|cgi|asp|aspx)$
      {
          proxy_pass https://改成你的-my.sharepoint.com;
          proxy_set_header Host 改成你的-my.sharepoint.com;
          proxy_set_header X-Real-IP $remote_addr;
          proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
          proxy_set_header REMOTE-HOST $remote_addr;   
          proxy_set_header Range $http_range;
      }
      location /
      {
          proxy_pass https://改成你的-my.sharepoint.com;
          proxy_set_header Host 改成你的-my.sharepoint.com;
          proxy_set_header X-Real-IP $remote_addr;
          proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
          proxy_set_header REMOTE-HOST $remote_addr;
          proxy_set_header Range $http_range; 
          
          add_header X-Cache $upstream_cache_status;
          
          #Set Nginx Cache
          
              add_header Cache-Control no-cache;
          expires 12h;
      }
      
      #PROXY-END/
      
  • SharePoint反代配置
    • 进入后台后,点击菜单栏中的 Hosts -> Proxy Hosts -> Add Proxy Hosts
    • Domain Names填写你的域名、SchemehttpsForward Hostname / IP填写 改成你的.sharepoint.comForward Port填写443
    • SSL Certificate选择Request a new SSL Certifite,打开Force SSLHTTP/2 SupportI Agree to the ...的开关
    • Custom Nginx Configuration填写下面的配置,最后点击Save
      #PROXY-START/
      location  ~* \.(php|jsp|cgi|asp|aspx)$
      {
          proxy_pass https://改成你的.sharepoint.com;
          proxy_set_header Host 改成你的.sharepoint.com;
          proxy_set_header X-Real-IP $remote_addr;
          proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
          proxy_set_header REMOTE-HOST $remote_addr;   
          proxy_set_header Range $http_range;
      }
      location /
      {
          proxy_pass https://改成你的.sharepoint.com;
          proxy_set_header Host 改成你的.sharepoint.com;
          proxy_set_header X-Real-IP $remote_addr;
          proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
          proxy_set_header REMOTE-HOST $remote_addr;
          proxy_set_header Range $http_range; 
          
          add_header X-Cache $upstream_cache_status;
          
          #Set Nginx Cache
          
              add_header Cache-Control no-cache;
          expires 12h;
      }
      
      #PROXY-END/
      

About

通过配置多个代理节点来代理OneDrive下载的流量,可根据访问者的运营商来分配指定的下载节点

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published