You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It works fine if I connect directly to the node service site
I found if I change path variable in function createHtmlFileList
from var path = dir.split('/').map(function (c) { return encodeURIComponent(c); });
to var path = [];
it works for my two cases.
Is there something I can do with the set up of serve-index to make it work?
thanks
Scott
The text was updated successfully, but these errors were encountered:
Hi Scott, you just need to have req.originalUrl set to the original one prior to the nginx rewrite for this (and other express middlewares) to generate proper URLs. A full explanation and example can be found in a previous response here: #53 (comment)
Let me know if you're still having an issue, though I am not familiar with nginx to help with any nginx specific questions.
Hi
I'm new to serve-index, so maybe I'm doing something wrong or my set up is a little different.
When I select the file to download from the page listing, it goes to the wrong path with my redirect through nginx access.
Listing all the files works fine for my directly connecting node service
http://nodeserver:3077/reports/
and with niginx redirect to (http://foo/bar > http://nodeserver:3077)
http://foo/bar/reports/
This is my code for adding "reports" folder to my site.
app.use('/reports/', express.static('./reports/'), serveIndex('./reports/', {'icons': true}));
But if I select the file for download on the nginx version the path is:
http://foo/reports/report1.txt
It drops the "bar", it should be
http://foo/bar/reports/report1.txt
It works fine if I connect directly to the node service site
I found if I change path variable in function createHtmlFileList
from
var path = dir.split('/').map(function (c) { return encodeURIComponent(c); });
to
var path = [];
it works for my two cases.
Is there something I can do with the set up of serve-index to make it work?
thanks
Scott
The text was updated successfully, but these errors were encountered: