Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use SSI inside the footer and/or header? #59

Open
assarbad opened this issue Oct 27, 2016 · 1 comment
Open

How to use SSI inside the footer and/or header? #59

assarbad opened this issue Oct 27, 2016 · 1 comment
Labels

Comments

@assarbad
Copy link

Hi,

could you explain where to find information on how to have SSIs (server side includes) as footer or header using ngx-fancyindex?

I tried the obvious

ssi on;
fancyindex on;
fancyindex_header HEADER.shtml;
fancyindex_footer FOOTER.shtml;

The files exist and worked like that in Apache 2.2. However, it appears as if the header and footer are not being processed by the SSI module.

Any ideas?

Thanks in advance and thanks also for your module.

btw: I am using the version of the module which is included in Ubuntu 16.04.

@aperezdc
Copy link
Owner

aperezdc commented Nov 1, 2016

I haven't tried to use SSI for headers/footers myself for years, but it should work. Internally fancyindex_header and fancyindex_footer perform an internal Nginx subrequest, so you have to make sure that the locations to which they point has SSI enabled with:

ssi on;

Also, if your header and footer files are going to be the same global ones for all directory listings (and not files inside the directory being listed), it's a good idea to use a separate location block for for them, so you don't need to have SSI enabled globally (beware, snippet untested):

fancyindex on;
fancyindex_header /.fancy/HEADER.shtml;
fancyindex_footer /.fancy/FOOTER.shtml;

location /.fancy/ {
   ssi on;
   root /srv/www/fancyindex-templates;
}

Can you please double-check that you are enabling SSI, and that the location from where the .shtml files are loaded is processing SSI correctly? You can try loading one of your .shtml file with curl from the command line, to see if Nginx is processing them without adding Fancyindex in the mix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants