apache到nginx重写

apache到nginx重写,apache,nginx,rewrite,Apache,Nginx,Rewrite,我刚从apache更改为nginx,我需要进行设置 在apache上进行了一些重写,我使用了这个 RewriteEngine on RewriteRule ^(.+)/$ index.php 但是,nginx不会像apache那样识别此规则 现在我试着去nginx manuel和google,但运气不太好 我想要它做的是获取url www.mydomain.com/index.php/mycontrollername www.mydomain.com/index.php/mycontrolle

我刚从
apache
更改为
nginx
,我需要进行设置 在apache上进行了一些重写,我使用了这个

RewriteEngine on
RewriteRule ^(.+)/$ index.php
但是,
nginx
不会像apache那样识别此规则 现在我试着去nginx manuel和google,但运气不太好 我想要它做的是获取url

www.mydomain.com/index.php/mycontrollername
www.mydomain.com/index.php/mycontrollername/
我希望它能与traling slash一起工作,也能与traling slash一起工作 如果有人能帮我一把或给我指导,我会非常高兴的

你看了吗?我看了,但是我说“警告:这篇文章已经过时了。请参考最新的官方文档。”所以我去了那里,但是nginx config对我来说是非常新的。然而,我们已经改变了主意,希望它只显示index.php,不管客户端按什么“链接”,但我仍然空手而归。