更新时间:2023-11-29 20:08:58
显然是别名和 try_files don'一起工作.但是,我认为您不需要使用别名.
Apparently alias and try_files don't work together. However, I don't think you need to use alias.
location /mr {
default_type "text/html";
try_files /fullpath/$uri /fullpath/$uri.html /fullpath/$uri/index.html /fullpath/index.html;
}
哪个会尝试:
我认为 root 指令确实适用于 try 文件,但无法测试.
I think the root directive does work with try files but am unable to test.
server{
location /mr {
root /home/mysite/fullpath;
default_type "text/html";
try_files $uri $uri.html $uri/index.html index.html;
}
}