# How I easily serve all files from a directory?

**URL:** <https://www.ruby-forum.com/t/how-i-easily-serve-all-files-from-a-directory/195718>\
**Category:** NGINX\
**Created:** [September 29, 2010, 12:44am UTC](https://www.ruby-forum.com/t/how-i-easily-serve-all-files-from-a-directory/195718 "2010-09-29T00:44:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![audreylee88](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ecae2f/32.png) [@audreylee88](https://www.ruby-forum.com/u/audreylee88)\
**Post date:** [September 29, 2010, 12:44am UTC](https://www.ruby-forum.com/t/how-i-easily-serve-all-files-from-a-directory/195718/1 "2010-09-29T00:44:50Z")

</div>

Hello nginx people,

is it easy to configure nginx so that it will serve html for a  
directory?  
I want the html to list all files in that directory.

My directory would be like this:

nginx/html/mydir/

And I would fill it with files like:  
my.html  
our.txt  
your.jpg  
their.pdf

So if I browse [http://audreyis.me/mydir/](http://audreyis.me/mydir/)

I would see links to those files.

I think apache has this feature but I dont want to use apache.

Here is an example of what I am looking for:

[http://howto.unixdev.net/dirlist.html](http://howto.unixdev.net/dirlist.html)

thanks!

---

<div class="post-metadata">

**Author:** ![audreylee88](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ecae2f/32.png) [@audreylee88](https://www.ruby-forum.com/u/audreylee88)\
**Post date:** [September 29, 2010, 12:49am UTC](https://www.ruby-forum.com/t/how-i-easily-serve-all-files-from-a-directory/195718/2 "2010-09-29T00:49:31Z")

</div>

I figured it out:

I found a directive:  
autoindex on;

```
server {
    listen 8222;
    server_name localhost;
    autoindex on;

```

Thanks me!
