nginx的实现方法是这样的:
在虚拟主机里添加一条这样的代码,
location / {
add_header content-type “text/html”;
}
就是强制在每个文件的header上,贴上html的标签,告诉浏览器要这样去解析它。
1是个目录吧?只是目录里面没有index而已,你在1这个目录添加个index.html或者index.php就可以了
nginx.conf中对应的location区域或者server区域,加入index index.html,将1改为index.html就行了
Content-Type:text/html;charset=utf-8