VPS侦探论坛

 找回密码
 注册
查看: 3959|回复: 2

lnmp1.4下typecho404页面不生效

[复制链接]
发表于 2017-8-1 22:08:59 | 显示全部楼层 |阅读模式

就是目前lnmp1.4环境,但是typecho的自定义404页面没有效果,甚至不会显示nginx的404页面,只会提示:


找不到 blog.dearjohn.cn 的网页
找不到与以下网址对应的网页




是不是跟vhost的conf有关?麻烦军哥看一下~ 另外同一个服务器上的wordpress站点就没有这个问题~

  1. server
  2.     {
  3.         listen 80;
  4.         #listen [::]:80;
  5.         server_name blog.dearjohn.cn ;
  6.         index index.html index.htm index.php default.html default.htm default.php;
  7.         root  /home/wwwroot/typecho;

  8.         include typecho.conf;
  9.         #error_page   404   /404.html;

  10.         # Deny access to PHP files in specific directory
  11.         #location ~ /(wp-content|uploads|wp-includes|images)/.*\.php$ { deny all; }

  12.         include enable-php.conf;

  13.         location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
  14.         {
  15.             expires      30d;
  16.         }

  17.         location ~ .*\.(js|css)?$
  18.         {
  19.             expires      12h;
  20.         }

  21.         location ~ /.well-known {
  22.             allow all;
  23.         }

  24.         location ~ /\.
  25.         {
  26.             deny all;
  27.         }

  28.         access_log off;
  29.     }
复制代码

美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2017-8-2 08:57:22 | 显示全部楼层


对了,同样的conf在lnmp1.3下没有问题,1.3加上include enable-php-pathinfo.conf;才能伪静态,但是404都正常跳转的,1.4不加pathinfo也能伪静态,但不论加不加都无法正常跳转404~
可能是1.4的bug吗?
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2017-8-2 12:21:08 | 显示全部楼层

http://docs.typecho.org/themes/custom-404

1.3和1.4的虚拟主机配置文件上没区别
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-9-25 15:29 , Processed in 0.025583 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表