LNMP下typecho的404问题解决
正确的配置如下,需要打开 phpinfo.conf 和typecho.conf
server
{
listen 80;
#listen [::]:80;
server_name ipvb.org;
index index.php index.html index.htm default.html default.htm default.php;
root /home/wwwroot/ipvb.org;
include typecho.conf;
#error_page 404 /404.html;
location ~ [^/]\.php(/|$)
{
# comment try_files $uri =404; to enable pathinfo
# try_files $uri =404;
fastcgi_pass unix:/tmp/php-cgi.sock;
fastcgi_index index.php;
include fastcgi.conf;
#include typecho.conf;
include pathinfo.conf;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
access_log /home/wwwlogs/ipvb.org.log access;
}
打开你的typecho站点文章页或者登录管理页面,验证问题是不是已经解决了!从此完美至此pathinfo
echo后台就可以设置 rewrite了
typecho.conf
location / {
index index.html index.php;
if (-f $request_filename/index.html){
rewrite (.*) $1/index.html break;
}
if (-f $request_filename/index.php){
rewrite (.*) $1/index.php;
}
if (!-f $request_filename){
rewrite (.*) /index.php;
}
}
注意:
这个typecho 404问题的解决方法,只敢保证可以解决军哥的LNMP1.1 LNMP1.2 一键安装包环境安装typecho后出现404问题,其他的情况,不敢确定。
实例网站: http://0769.us 正常访问,没有任何问题
扫描二维码推送至手机访问。
版权声明:本文由学无止境-开拓创新-ipvb学习网发布,如需转载请注明出处。