Nginx 配置 TinkPHP 5.1

server {
listen 8082;
server_name 192.168.56.99;
index index.html index.htm index.php;
// 注意此目录会涉及到 include_dir 的配置
root /data/project/morseapp-api/public;
autoindex on;
autoindex_exact_size off;
autoindex_localtime on;
location / {
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=/$1 last;
break;
}
}
location ~ .*\.(php|php5)?$ {
try_files $uri =404;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
// -- 修改PHP默认的 include_dir 目录 --- Start
set $document_base_dir "/data/project/morseapp-api";
fastcgi_param PHP_ADMIN_VALUE "open_basedir=$document_base_dir:/tmp/:/var/tmp/:/proc/";
fastcgi_split_path_info ^((?U).+.php)(/?.+)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
// -- 修改PHP默认的 include_dir 目录 --- END
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
include fastcgi.conf;
}
location = /favicon.ico { // 访问日志
access_log off;
log_not_found off; //
}
# access_log off; // 关闭访问日志
access_log logs/morseapp-api.com.access.log;
error_log logs/morseapp-api.com.error.log;
}