由于某些离谱的原因,clone github上面的项目时速度往往不到100k/s
所以,需要用点奇奇怪怪的东西,比如利用NGINX反向代理一下GitHub
server { listen 80; listen [::]:80; server_name example.com example.example.com ; if ($http_user_agent ~* "qihoobot|Baiduspider|Googlebot|Googlebot-Mobile|Googlebot-Image|Mediapartners-Google|Adsbot-Google|Feedfetcher-Google|Yahoo! Slurp|Yahoo! Slurp China|YoudaoBot|Sosospider|Sogou spider|Sogou web spider|MSNBot|ia_archiver|Tomato Bot") #防止搜索引擎收录 { return 403; } location /git { #这里设置github地址 proxy_pass https://github.com/; proxy_buffering off; #proxy_buffer_size 4k; proxy_connect_timeout 300s; proxy_read_timeout 300s; proxy_send_timeout 300s; send_timeout 300s; #开启websocket proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header Host github.com; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-Host $server_name; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-Ssl on; } location ~ \.well-known{ allow all; } }
表扬一下?