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

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

WBOY
Release: 2016-06-23 13:53:22
Original
979 people have browsed it

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

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

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template