在本地搭建了typecho,除了首页,其它页面都是404错误,下面是解决问题出现这问题的办法,记录备用。

location ~ .*\.php(\/.*)*$ {
    root           /www/typecho; #站点目录
    fastcgi_pass   127.0.0.1:9000;
    fastcgi_index  index.php;
    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
    include        fastcgi_params;
    #上面的几段是默认配置里就有的, 下面几段参考http://docs.typecho.org/servers
    set $path_info "";
    set $real_script_name $fastcgi_script_name;
    if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") {
            set $real_script_name $1;
            set $path_info $2;
    }
    fastcgi_param SCRIPT_FILENAME $document_root$real_script_name;
    fastcgi_param SCRIPT_NAME $real_script_name;
    fastcgi_param PATH_INFO $path_info;
}