nginx yii2配置文件

应用配置文件

server {

    listen 80;

        server_name local.core.api;

    root /Users/li/Documents/www/CoreAPI/;

    

    location / {

    index index.php;

    autoindex on;

                if (!-f $request_filename) {

rewrite (.*) /webroot/index.php;

}

    }

 

    location ~ ^(.+\.php)(.*)$  {

    #include /Users/edwardzhou/servers/nginx/conf/fastcgi.conf;

    fastcgi_intercept_errors on;

    fastcgi_pass 127.0.0.1:9000;

 

            set $document_root2 $document_root;

            if ($document_root2 ~ "^(.*\\\\).*?[\\\\|\/]\.\.\/(.*)$") { set $document_root2 $1$2; }

            if ($document_root2 ~ "^(.*\\\\).*?[\\\\|\/]\.\.\/(.*)$") { set $document_root2 $1$2; }

            if ($document_root2 ~ "^(.*\\\\).*?[\\\\|\/]\.\.\/(.*)$") { set $document_root2 $1$2; }

            if ($document_root2 ~ "^(.*\\\\).*?[\\\\|\/]\.\.\/(.*)$") { set $document_root2 $1$2; }

            if ($document_root2 ~ "^(.*\\\\).*?[\\\\|\/]\.\.\/(.*)$") { set $document_root2 $1$2; }

 

            fastcgi_split_path_info ^(.+\.php)(.*)$;

            fastcgi_param   SCRIPT_FILENAME $document_root2$fastcgi_script_name;

            fastcgi_param   PATH_INFO   $fastcgi_path_info;

            fastcgi_param   PATH_TRANSLATED $document_root2$fastcgi_path_info;

            include fastcgi_params;

            fastcgi_param  DOCUMENT_ROOT      $document_root2;

    }

    }

posted @ 2016-04-05 14:52  秋风落叶.  阅读(760)  评论(0编辑  收藏  举报