Nginx开启目录浏览功能、并添加utf8编码防止中文目录乱码
Warning: Undefined variable $output in /home/wwwroot/xiaoyuo.com/wp-content/themes/ripro-child/functions.php on line 68
本文共480个字,预计阅读时间需要2分钟 发布时间: 2024-10-4 共3.19K人阅读
Nginx开启目录浏览功能、并添加utf8编码防止中文目录乱码
宝塔面板用户直接在站点管理,对应网站配置文件里添加即可,完整代码如下:
autoindex on;charset utf-8,gbk;autoindex_exact_size on;autoindex_localtime on;
autoindex on;
是开启目录浏览的功能。
charset utf-8,gbk;
这一段就是指定编码的。
autoindex_exact_size off;
默认为on,显示出文件的确切大小,单位是bytes。
改为off后,显示出文件的大概大小,单位是kB或者MB或者GB
autoindex_localtime on;
默认为off,显示的文件时间为GMT时间。
改为on后,显示的文件时间为文件的服务器时间
预览效果:


下载仅供下载体验和测试学习,不得商用和正当使用。
常见问题FAQ
Warning: foreach() argument must be of type array|object, string given in /home/wwwroot/xiaoyuo.com/wp-content/themes/ripro-child/parts/author-box.php on line 12