location ~ (^/test$|test.php$) { rewrite ^/(^/test$) /$1.php last; include fastcgi.conf; fastcgi_pass unix:/tmp/php-cgi.sock; fastcgi_index index.php; }
这样访问test时实际访问的是test.php。
转载于:https://blog.51cto.com/linchqd/1348374
location ~ (^/test$|test.php$) { rewrite ^/(^/test$) /$1.php last; include fastcgi.conf; fastcgi_pass unix:/tmp/php-cgi.sock; fastcgi_index index.php; }
这样访问test时实际访问的是test.php。
转载于:https://blog.51cto.com/linchqd/1348374