nginx的全网代理配置

八月 20th, 2009 Posted in Nginx | 阅读次数: 216 次

文章来自ayou  http://nginx.cn

location /get/
{
set $hostx “”;
set $addrs “”;
if ( $uri ~ “^/get/http./+([^/]+)/(.+)$”) {
set $hostx $1;
set $addrs $2;
}
resolver 127.0.0.1;
proxy_pass http://$hostx/$addrs;
proxy_set_header referer “http://$hostx”;
}

这个配置可以代理互联网上的所有http页面/图片,并且可越过一般的防盗链限制。

访问方法:http://www.sudone.com/get/http://www.google.com/tools/dlpage/res/chrome/images/chrome-205_noshadow.png

因为nginx不会自动读取系统的dns去解析域名,所以需要定义一个resolver作为dns服务器。

注,为了减少“麻烦”,我并没有将此功能部署到正式场合

随机日志

4 Responses to “nginx的全网代理配置”

  1. Home Remedies for Yeast Infections Says:

    Recommended Sites…

    [...]below you can check out my recommended links page http://www.yeastinfectiontreatmentcure.net/links/ with some excellent websites that I think you should definitely go visit[...]…


  2. Related Resources Says:

    Related Websites…

    [...]here are some other links to sites that we find everyday so here are some popular sites we like today[...]…


  3. hotel in venice Says:

    You should check this out……

    [...] Wonderful story, reckoned we could combine a few unrelated data, nevertheless really worth taking a look, whoa did one learn about Mid East has got more problerms as well [...]………


  4. sunglasses Says:

    WOW! check this out!……

    Amazing Post, worth a read……


留下您的脚印