soyuka / explorer

Explore and share. Highly-configurable directory listing made with nodejs.
http://soyuka.github.io/explorer/
MIT License
179 stars 19 forks source link

Cant run in subdirectory (app_root) #45

Closed bkanuka closed 6 years ago

bkanuka commented 6 years ago

I'm having trouble getting this to run under a subdirectory/url like example.com/files. It seems to work for the most part, but not all the url's in explorer respect the app_root setting. Some point to example.com/download rather than example.com/files/download

My nginx config is:

    location /files {
        return 301 https://$server_name/files/;
    }

    location /files/ {
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass http://explorer/;
    }
soyuka commented 6 years ago

Yeah quick fix:

In:

https://github.com/soyuka/explorer/blob/master/views/index.haml#L4

Add:

%base{href: app_root}

Should work. Maybe we need to remove the prefixed app_root on stylesheet + javascript after that change.