No description
Find a file
2022-01-29 17:12:21 +01:00
.idea all the base and vendor files needed 2016-02-11 12:53:19 +01:00
assets adding screenshots 2016-02-12 16:24:55 +01:00
css style: Add gruvbox stylesheet 2022-01-29 17:02:35 +01:00
image adding sort by size and better error handling 2016-02-11 19:12:27 +01:00
js adding some docs to main JS file 2016-02-15 11:38:06 +01:00
.gitignore all the base and vendor files needed 2016-02-11 12:53:19 +01:00
default.conf using alias in nginx config for /files to save headaches 2016-02-15 11:32:31 +01:00
Dockerfile adding sample docker file and nginx config 2016-02-11 22:17:49 +01:00
index.html fixing mis-shaped link 2016-06-22 14:13:54 +02:00
LICENSE adding license and readme 2016-02-12 08:58:41 +01:00
README.md doc: Add info about theme in readme 2022-01-29 17:12:21 +01:00

nginx file browser

This web application is a very simple file browser which can be used effectively together with nginx's autoindex module.

nginx file browser in action

A sample nginx configuration is also included which mounts file browser under root (/) and mounts files to be listed under /files path. Hence is the filesBaseUrl under

Using with docker

Mainly for demonstration purposes a docker image is also available here. In order to use this docker image, the volume which has to be served should be mounted under /opt/www/files/ and port 80 of container shall be mapped to a proper port on host. A proper run would look like:

$ docker run -p 8080:80 -v /path/to/my/files/:/opt/www/files/ mohamnag/nginx-file-browser

With container up and running you can point your browser to IP of docker host with given port to view the files. For example with above run command assuming docker host having IP with 192.168.0.200 we have to navigate to this URL:

http://192.168.0.200:8080

Be very careful with symlinks, they can expose very important files of system to outside world!

If you have symlinks inside files dir that you want to be able to browse too, the alias path where /files is served by nginx has to be changed to match the same path outside your docker container. Lets say I have a directory with path /home/myuser/files-to-serve/. Which has two directories named dir1 and dir2. where dir1 is nothing more than a symlink to dir2. In order to be able to browse dir1 (inside dir2) on file browser, following have to be done:

Inside default.conf this line

    alias /opt/www/files/;

shall be changed to

    alias /home/myuser/files-to-serve/;

And the mounting point is now /home/myuser/files-to-serve/ instead of /opt/www/files/.

Gruvbox theme

A gruvbox theme is present in the css. You can use it by editing line 12 of the index.html. Simply change the link from css/main.css to css/main-gruvbox.css This theme is heavily inspired from iTerm2 color scheme that can be found here: link