【发布时间】:2017-12-30 23:33:36
【问题描述】:
我目前正在使用 NGINX(和 PHP-FPM)学习 REST。
我有几个关于路由的问题(例如 /customers)。
首先我应该使用 NGINX 还是 PHP 进行路由(将它们作为重写规则,如 /customer/{cusID} 将映射到 /customer.php?cusid={cusid}) 或根据 /customer/{cusID} 映射到 /customer.php 进行重写,然后处理是否有使用 PHP 的 URI 中的 cusID 资源?
其次,rewrite 是不是最好的实现方式,我看到你可以在 NGINX 中使用 alias 来做类似的事情?
【问题讨论】: