当前位置:Gxlcms > PHP教程 > 【在线等】这个地址如何在nginx里面配置?

【在线等】这个地址如何在nginx里面配置?

时间:2021-07-01 10:21:17 帮助过:2人阅读

http://ip/Api/ApiCollection.php/v1/user/1

在 nginx 里面如何配置,才能通过 url

http://ip/Api/ApiCollection/v1/user/1 访问呢?


回复讨论(解决方案)

隐去文件名
location /{
index index.html index.htm index.php;
if (-e $request_filename) {
break;
}
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php/$1 last;
break;
}
}

你可以使用一种框架,都带路由功能

人气教程排行