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; }