示例2
# http://www.test.com/test/abc/1.html ⇒ http://www.test.com/ccc/bbb/2.html
location /test {
rewrite .*
/ccc/bbb/2.html permanent;
}
# http://www.test.com/2015/ccc/bbb/2.html ==> http://www.test.com/2014/ccc/bbb/2.html
location /2015
{
rewrite ^/2015/(.*)$ /2014/$1 permanent;
}
# http://www.test.com/2015/ccc/bbb/2.html ==> http://jd.com/index.php
location /2015
{
if
($host ~* test.com)
{
rewrite .* http://www.jd.com/index.php permanent;
}
}
# http://www.test.com/kkk/1.html ==> http://jd.com/kkk/1.html
location /
{
root html;
index index.html index.htm;
if
($host ~* test.com)
{
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。