Nginx 环境配置 CodeIgniter 框架_PHP_编程开发_程序员俱乐部

中国优秀的程序员网站程序员频道CXYCLUB技术地图
热搜:
更多>>
 
您所在的位置: 程序员俱乐部 > 编程开发 > PHP > Nginx 环境配置 CodeIgniter 框架

Nginx 环境配置 CodeIgniter 框架

 2012/8/21 11:06:35  netkiller.github.com  程序员俱乐部  我要评论(0)
  • 摘要:只有一个入口文件index.php防止js/css/images中有PHPlocation/{root/www/mydomain.com/report.mydomain.com/htdocs;indexindex.phpindex.html;if($request_filename!~(js|css|images|robots/.txt|index/.php)){rewrite^/(.*)$/index.php/$1last;break;}}location~*^.+.(jpg|jpeg
  • 标签:配置 Nginx

?

  1. 只有一个入口文件index.php
  2. 防止js/css/images 中有PHP

?

?

	location / {
        root   /www/mydomain.com/report.mydomain.com/htdocs;
        index  index.php index.html;

        if ($request_filename !~ (js|css|images|robots/.txt|index/.php) ) {
                rewrite ^/(.*)$ /index.php/$1 last;
                break;
        }

    }

    location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|xml)$ {
        access_log        off;
        expires           7d;
    }

    location ~ \.php$ {
        if ($request_filename !~ (index/.php) ) {
                return 404;
        }
    }

	location ~ /index.php/ {
        root           html;
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME  /www/mydomain.com/report.mydomain.com/htdocs/index.php;
        include        fastcgi_params;
    }
?

?

?

发表评论
用户名: 匿名