nginx yii2配置文件
Posted 秋风落叶.
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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;
}
}
以上是关于nginx yii2配置文件的主要内容,如果未能解决你的问题,请参考以下文章
yii2 在nginx 下怎么隐藏 frontend/web