码迷,mamicode.com
首页 > Web开发 > 详细

mac nginx+ci ,lumen等网页开发环境配置

时间:2016-06-16 11:42:18      阅读:408      评论:0      收藏:0      [点我收藏+]

标签:

1、设置/ete/hosts:

把要访问的域名绑定到本地的端口

这样能保证我们登陆域名的时候,可以重定向到本地。

127.0.0.1       mobile.ymt360.com

127.0.0.1       my-uc-test.ymt360.com

127.0.0.1       localhost

255.255.255.255 broadcasthost

::1             localhost

~                         

 

2、nginx 配置+启动。

  安装nginx不细讲,主要讲配置(域名引用到对应的文件目录)

   1、配置server

server {

    listen 80;

    server_name mobile.ymt360.com;

    index index.php;

    root /data/www/website/mobile/public;

    access_log  /data/nginxlogs/mobile.ymt360.com.log;

    error_log /data/nginxlogs/mobile.ymt360.com.error;

    client_max_body_size 12m;

    error_page 502 /502.html;

 

    location / {

        index index.php;

        if (!-e $request_filename) {

            rewrite ^/(.+)$ /index.php/$1 last;

        }

    }

 

    location ~ ^/index\.php {

        set $path_info "";

        set $real_script_name $fastcgi_script_name;

        if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") {

            set $real_script_name $1;

            set $path_info $2;

        }

        charset utf-8;

        fastcgi_param PATH_INFO $path_info;

        include fastcgi.conf;

    }

 

    location ~ .*\.php$ {

        deny all;

    }

}

php-fastcgi配置

这里路径用9000端口

mac nginx+ci ,lumen等网页开发环境配置

标签:

原文地址:http://www.cnblogs.com/zhezhong/p/5590443.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!