Git Product home page Git Product logo

nginx-file-browser's Introduction

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

Symlinks

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/.

nginx-file-browser's People

Contributors

mohamnag avatar elisaado avatar

Watchers

Deivid Roger Oliveira Santos avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.