重定向到其余域名,URL保持不变

apache规则里[L,P]中P的意思是强制为代理,请求的URL不会变了

Nginx没有强制重写为代理的参数,可使用一种变通的方法location:

html

    location ~ ^/article/ {
           rewrite ^/article/([^/\.]+)-p([0-9]+)(/?)$ /c/article/$1/article-list/$2.shtml  break;
           proxy_pass  http://csdn.net;
    }
相关文章
相关标签/搜索