VPS侦探论坛

 找回密码
 注册
查看: 8921|回复: 3

nginx下使用codeigniter

[复制链接]
发表于 2010-12-2 15:23:21 | 显示全部楼层 |阅读模式

小弟在nginx的vhost下加下了rewrite rule, 但出現了500 Internal Server Error. 請求師兄教一下.

想使用的framework是codeigniter

rewrite rule:
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php/$1 last;
                                        }
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2012-12-9 18:25:27 | 显示全部楼层


CI在LNMP下的Rewrite这样写:
  1. location / {
  2.         if ($request_uri ~* ^/system) {
  3.                 rewrite ^/(.*)$ /index.php?/$1 last;
  4.                 break;
  5.         }

  6.         if (!-e $request_filename) {
  7.                 rewrite ^/(.*)$ /index.php?/$1 last;
  8.                 break;
  9.         }
  10. }
复制代码
建军哥更新到lnmp里。

[ 本帖最后由 heii 于 2012-12-9 18:28 编辑 ]
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2012-12-9 18:42:54 | 显示全部楼层

好的
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2013-6-6 16:51:17 | 显示全部楼层



还有就是$config['uri_protocol']        = 'REQUEST_URI';  选这个才行    nginx貌似默认不支持path_info
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-9-24 15:20 , Processed in 0.025415 second(s), 17 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表