Welcome! Log In Create A New Profile

Advanced

Module fancyindex template

Posted by mdhp 
Module fancyindex template
October 15, 2011 01:11PM
Somebody now how to use an own header with fancyindex ?

Without "fancyindex_header" everything is ok and i see 10 direcoties, but i want to use an own header.

I try this:

location / {
fancyindex on;
fancyindex_exact_size on;
fancyindex_header /my_header.html;
}


File: my_header.html
---
Hello World!
---


But then i did not see any directory listing, only

--
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8"/><style type="text/css">body,html {background:#fff;font-family:"Bitstream Vera Sans","Lucida Grande","Lucida Sans Unicode",Lucidux,Verdana,Lucida,sans-serif;}tr.e {background:#f4f4f4;}th,td {padding:0.1em 0.5em;}th {text-align:left;font-weight:bold;background:#eee;border-bottom:1px solid #aaa;}#list {border:1px solid #aaa;width:100%;}a {color:#a33;}a:hover {color:#e33;}</style>

<title>Index of /</title>
</head><body><h1>Index of </body></html>
--


nginx 1.0.8
fancyindex 0.3.1
Re: Module fancyindex template
October 29, 2011 02:01PM
I hit the same problem. I ditched FancyIndex and went with:

add_before_body /header.html;

instead. You need to compile the option in: --with-http_addition_module.
Re: Module fancyindex template
February 08, 2012 10:26AM
I edit and compile fancyindex with my own template to solve my problem.

Edit template.h in ngx-fancyindex

Complicated but work ;-)
Re: Module fancyindex template
April 12, 2012 07:45PM
Hello! Somewhat related... I would like to know if it is possible to do a "fancyindex_footer README.txt" but only display README.txt if it exists? You can achieve this with Apache/Lighttpd. Use case, directory listing of files with README.txt in the root directory, no README.txt in subdirs. I want to avoid the 404 page on the subdirs.

Thanks!
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 183
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready