The website is built using Thinkphp, and Nginx is used as the proxy server.
Nginx rewrite configuration is as follows:
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s= last;
break;
}
Normal address:
http://aaa.com/api/home?id=1
You can also access it if you want to change it to the following (add .php suffix):
http://aaa.com/api/home.php?id=1
Please tell me how to configure Nginx?
漂亮男人2017-05-16 17:18:55
Match the directory under the api:
rewrite /api/(.*)\.php /api/ permanent;