openwrt源在大陆访问实在太痛苦了!所幸香港ip访问速度尚可,本文将利用nginx反代作为openwrt源做代理.
必须条件:一台装有nginx的,访问openwrt源速度尚可的vps
一.配置反向代理
server {
listen 80;
server_name downloads.openwrt.org;
index index.php index.html index.htm;
location / {
default_type text/html;
subs_filter_types text/css text/xml;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Referer http://downloads.openwrt.org;
proxy_set_header Host downloads.openwrt.org;
proxy_pass http://downloads.openwrt.org;
proxy_set_header Accept-Encoding “”;
}
}
二.修改openwrt hosts
vi /etc/hosts
添加一行:
xxx.xxx.xxx.xxx downloads.openwrt.org #xxx.xxx.xxx.xxx为反代服务器IP.
这样,就能愉快的更新源了.
- 本文固定链接: http://ninecmd.com/archives/828
- 转载请注明: NINE 于 NINE的博客 发表
Pingback 引用通告: 搭建一个openwrt源 | NINE的博客