nginx域名隐性(地址栏域名不变)跳转
时间:2016-05-11 19:42:34
收藏:0
阅读:1664
1、完全url的域名隐性跳转
server_name a.b.com
location / {
proxy_pass http://x.y.com;
}
效果:浏览器地址栏中输入a.b.com域名不变访问的内容为x.y.com上的内容
2、部分url的域名隐性跳转到非根目录下的内容
server_name a.b.com
location ~ .*\.(js|css)$ {
rewrite ^/(.*) /js/$1 break;
proxy_pass http://x.y.com break;
}
效果:浏览器地址栏中输入a.b.com域名不变其实访问的内容是x.y.com/js/下的内容。
原文:http://www.cnblogs.com/su-han/p/5483209.html
评论(0)