lnmpa 移动端最近访问目录页显示404,要在后缀加index.html
如标题所示,之前一直好好的,我检查过配置文件,index默认文档是index.html,可就是移动端访问目录就显示502错误,要在网址加上index.html才可以访问 ,如访问https://m.haomamayuer.com/chanhou/ 就显示502
加后缀https://m.haomamayuer.com/chanhou/index.html就正常显示
我测试nginx -t显示正常,不知道是哪里出现了问题。求教各位了!
移动端配置文件如下:
server
{
listen 80;
#listen [::]:80;
server_name m.haomamayuer.com ;
return 301 https://m.haomamayuer.com$request_uri;
index index.html;
root /home/wwwroot/www.haomamayuer.com/m;
rewrite ^/m/tag/(.*).html$ https://m.haomamayuer.com/tag/$1.html;
error_page 404 /404.html;
# Deny access to PHP files in specific directory
#location ~ /(wp-content|uploads|wp-includes|images)/.*\.php$ { deny all; }
include proxy-pass-php.conf;
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
location ~ /.well-known {
allow all;
}
location ~ /\.
{
deny all;
}
access_log/home/wwwlogs/m.haomamayuer.com.log;
}
server
{
listen 443 ssl http2;
#listen [::]:443 ssl http2;
server_name m.haomamayuer.com ;
index index.html;
root/home/wwwroot/www.haomamayuer.com/m;
error_page 404 /404.html;
# Deny access to PHP files in specific directory
#location ~ /(wp-content|uploads|wp-includes|images)/.*\.php$ { deny all; }
include proxy-pass-php.conf;
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
location ~ /.well-known {
allow all;
}
location ~ /\.
{
deny all;
}
access_log/home/wwwlogs/m.haomamayuer.com.log;
}
已经解决
页:
[1]