nginx访问目录的时候自动在后面加上 / if (-d $request_filename){ rewrite ^/(.*)([^/])$ http://$host/$1$2/ permanent; }