哦你这种写法也行,不过得修改下加上proxy_redirect ,而不是用subs_filter
修改配置文件如下
server {
listen 80;
server_name
abcd.com www.abcd.com;
proxy_redirect
http://site001.cdn.abcd.com/ /;
location / {
proxy_pass
http://site001.cdn.abcd.com;
proxy_connect_timeout 60s;
proxy_read_timeout 5400s;
proxy_send_timeout 5400s;
proxy_redirect off;
if ($request_filename ~* .*\.(gif|jpg|jpeg|png|bmp|swf)$)
{
expires 30d;
}
if ($request_filename ~ .*\.(js|css|htm|html)?$)
{
expires 12h;
}
}
}