【发布时间】:2022-01-16 12:27:45
【问题描述】:
我正在创建一个 Nginx 文件服务器,并且我正在尝试启用 fancy-index 模块以获得自定义页眉和页脚,但我无法让它工作,页眉/页脚永远不会加载。 (请求甚至没有从浏览器完成)。
目前,我已经学习了本教程:https://neilmenon.com/blog/install-nginx-fancyindex
我当前的网站配置是
server {
listen 80;
server_name myname;
autoindex on;
autoindex_exact_size off;
autoindex_localtime on;
location / {
root /var/www/html
fancyindex on;
fancyindex_exact_size off;
fancyindex_footer /fancy-index/footer.html;
fancyindex_header /fancy-index/header.html;
fancyindex_css_href /fancy-index/style.css;
fancyindex_time_format "%B %e, %Y";
}
}
我还在文件第一行的 nginx.conf 中加载了模块
load_module /usr/share/nginx/modules/ngx_http_fancyindex_module.so;
我还澄清说我是 nginx 新手,所以如果这是我应该注意的常见问题,我深表歉意。
提前致谢,任何帮助将不胜感激
【问题讨论】: