PHP程序员

server { listen 80;

↓此处请配置你自己的域名

server_name  blog.make3.cn;

charset      utf-8;

#    access_log  /var/log/nginx/phalcon/access.log  main;
# ↓此处请更改为你自己的服务器的绝对路径 
set $root_path '/home/blog';
root $root_path;
#try_files $uri $uri/ @rewrite;
index index.php index.html;
location / {

    try_files $uri $uri/ /index.php?$query_string;
}

location ~ \.php$ {
    fastcgi_index  index.php;
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    fastcgi_pass  127.0.0.1:9000;
    fastcgi_param PATH_INFO $fastcgi_path_info;
    fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
    include fastcgi_params;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}

location ~* ^/(css|img|js|flv|swf|download)/(.+)$ {
    root $root_path;
}

}

参考:

wiki.iminho.me/docs/show/9


                       Bill Zhang
                         Thanks

评论
...

小明

有来过,666666。

4楼  2017-08-08  23:15发表