比如说我服务器是 myserver.com ,
当访问时 myserver.com/v2ex.com/download/client.tar.gz ,
会通过我的服务器代理下载 v2ex.com/download/client.tar.gz 。
或者通过curl把要下载的资源url post过来,代替get。
1
winooxx 2016 年 4 月 22 日
这难道不是反代吗 - -
|
4
plqws 2016 年 4 月 22 日
用 lua 的话大概可以实现,但是没法通过配置文件来实现的…
|
5
oott123 2016 年 4 月 22 日
配置文件可以吧。
proxy_pass http://$host$request_uri; 大概这样。 |
6
oott123 2016 年 4 月 22 日
哦,不对,应该是
proxy_pass http://$uri; 记得设置 reslover ref: http://serverfault.com/questions/411832/dynamic-proxy-with-nginx-based-on-url-param |