Home  >  Article  >  Backend Development  >  【在线等】这个地址如何在nginx里面配置?

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

WBOY
WBOYOriginal
2016-06-23 13:53:22952browse

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

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

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn