nginx 配置
Posted best_jobs
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了nginx 配置相关的知识,希望对你有一定的参考价值。
server {
listen 8080;
server_name localhost;
root /Applications/thinkphp/;
location ~ \.php {
root /Applications/thinkphp/;
fastcgi_pass 127.0.0.1:9000;
include fastcgi.conf;
set $path_info "";
set $fastcgi_script_name_new $fastcgi_script_name;
if ($fastcgi_script_name ~* "^(.+\.php)(/.+)$" ) {
set $fastcgi_script_name_new $1;
set $path_info $2;
}
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name_new;
fastcgi_param SCRIPT_NAME $fastcgi_script_name_new;
fastcgi_param PATH_INFO $path_info;
}
location / {
index index.html index.htm index.php;
include /usr/local/etc/nginx/conf.d/php-fpm;
if (!-e $request_filename){
rewrite ^(.*)$ /index.php$1 last;
}
}
}
以上是关于nginx 配置的主要内容,如果未能解决你的问题,请参考以下文章