由于众所周知的原因,
想要通过离岸的服务器用 nginx 反向代理达到获取墙外文件,
但是配置总是失败。
例如:
访问 http://myserver/proxy/?url=http%3A%2F%2Fwww.anotherserver%2Ftest.css
nginx 服务器反代 http://www.anotherserver/test.css 并返回给客户端。
我是这样配置 nginx 的:
location ~^/proxy/?url=(.*)$ {
proxy_pass http://$1;
proxy_redirect off;
proxy_max_temp_file_size 0;
}
但是不起作用,请问应该如何修改?谢谢。
想要通过离岸的服务器用 nginx 反向代理达到获取墙外文件,
但是配置总是失败。
例如:
访问 http://myserver/proxy/?url=http%3A%2F%2Fwww.anotherserver%2Ftest.css
nginx 服务器反代 http://www.anotherserver/test.css 并返回给客户端。
我是这样配置 nginx 的:
location ~^/proxy/?url=(.*)$ {
proxy_pass http://$1;
proxy_redirect off;
proxy_max_temp_file_size 0;
}
但是不起作用,请问应该如何修改?谢谢。