VPS侦探论坛

 找回密码
 注册
查看: 362|回复: 1

lnmpa 移动端最近访问目录页显示404,要在后缀加index.html

[复制链接]
发表于 2024-3-24 18:59:58 | 显示全部楼层 |阅读模式

如标题所示,之前一直好好的,我检查过配置文件,index默认文档是index.html,可就是移动端访问目录就显示502错误,要在网址加上index.html才可以访问 ,如
访问https://m.haomamayuer.com/chanhou/ 就显示502
加后缀https://m.haomamayuer.com/chanhou/index.html就正常显示
我测试nginx -t显示正常,不知道是哪里出现了问题。求教各位了!

移动端配置文件如下:
  1. server
  2.     {
  3.         listen 80;
  4.         #listen [::]:80;
  5.         server_name m.haomamayuer.com ;
  6.         return 301 https://m.haomamayuer.com$request_uri;
  7.         index index.html;
  8.         root /home/wwwroot/www.haomamayuer.com/m;

  9.         rewrite ^/m/tag/(.*).html$ https://m.haomamayuer.com/tag/$1.html;
  10.         error_page   404   /404.html;

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

  13.         include proxy-pass-php.conf;

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

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

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

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

  29.         access_log  /home/wwwlogs/m.haomamayuer.com.log;
  30.     }

  31. server
  32.     {
  33.         listen 443 ssl http2;
  34.         #listen [::]:443 ssl http2;
  35.         server_name m.haomamayuer.com ;
  36.         index index.html;
  37.         root  /home/wwwroot/www.haomamayuer.com/m;

  38.      

  39.         error_page   404   /404.html;

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

  42.         include proxy-pass-php.conf;

  43.         location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
  44.         {
  45.             expires      30d;
  46.         }

  47.         location ~ .*\.(js|css)?$
  48.         {
  49.             expires      12h;
  50.         }

  51.         location ~ /.well-known {
  52.             allow all;
  53.         }

  54.         location ~ /\.
  55.         {
  56.             deny all;
  57.         }

  58.         access_log  /home/wwwlogs/m.haomamayuer.com.log;
  59.     }
复制代码




美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-5-8 11:54 , Processed in 0.025750 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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