nginx codeigniter重写:控制器名称与目录冲突
我正在尝试nginx并将我现有的apacheconfiguration移植到nginx。 我设法重新路由codeigniterurl的成功,但我有一个特定的控制器,其名称与站点根目录一致的问题。 我设法使我的codeigniterurl的工作,因为它在Apache中,除了我有一个特定的URL说http://localhost/hello这与网站根目录中的hello目录一致。 Apache对此没有任何问题。 但是nginx路由到这个目录而不是控制器。 我的重新路由结构如下 http://host_name/incoming_url => http://host_name/index.php/incoming_url 所有codeigniter文件都在站点根目录下。 我的nginxconfiguration(相关部分) location / { # First attempt to serve request as file, then # as directory, then fall back to index.html index index.php index.html index.htm; try_files $uri $uri/ /index.php/$request_uri; #apache rewrite rule conversion if (!-e $request_filename){ rewrite ^(.*)/?$ /index.php?/$1 last; } # Uncomment to enable […]