# Full Filename Directory Listing

**URL:** <https://www.ruby-forum.com/t/full-filename-directory-listing/194006>\
**Category:** NGINX\
**Created:** [August 27, 2010, 8:38pm UTC](https://www.ruby-forum.com/t/full-filename-directory-listing/194006 "2010-08-27T20:38:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mindfrost82](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/bc79bd/32.png) [@mindfrost82](https://www.ruby-forum.com/u/mindfrost82)\
**Post date:** [August 27, 2010, 8:38pm UTC](https://www.ruby-forum.com/t/full-filename-directory-listing/194006/1 "2010-08-27T20:38:40Z")

</div>

I have a nginx server setup and everything is working fine. I have a  
virtual server setup which allows directory listing (autoindex on;).

It appears to truncate the file names at around 50 characters.

Is it possible to disable this so that it will show the entire filename?  
Or is there a way to increase it to say 100 or 150 characters?

Thanks!

Posted at Nginx Forum:  
[http://forum.nginx.org/read.php?2,124400,124400#msg-124400](http://forum.nginx.org/read.php?2,124400,124400#msg-124400)

---

<div class="post-metadata">

**Author:** ![mindfrost82](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/bc79bd/32.png) [@mindfrost82](https://www.ruby-forum.com/u/mindfrost82)\
**Post date:** [January 19, 2011, 2:37am UTC](https://www.ruby-forum.com/t/full-filename-directory-listing/194006/2 "2011-01-19T02:37:51Z")

</div>

I looked all over the net and wasn’t able to find this answer anyway, so  
I looked into the nginx source files and it’s very easy.

Simply modify the file located at  
src/http/modules/ngx\_http\_autoindex\_module.c and then compile.

Change these lines:

[b]#define NGX\_HTTP\_AUTOINDEX\_PREALLOCATE 50

#define NGX\_HTTP\_AUTOINDEX\_NAME\_LEN 50[/b]

to whatever you want, such as:

[b]#define NGX\_HTTP\_AUTOINDEX\_PREALLOCATE 100

#define NGX\_HTTP\_AUTOINDEX\_NAME\_LEN 100[/b]

And then compile and restart nginx. That’s it !!!

Posted at Nginx Forum:

> **[Re: Full Filename Directory Listing](https://forum.nginx.org/read.php?2,124400,167420#msg-167420)**
>
> I have a nginx server setup and everything is working fine. I have a virtual server setup which allows directory listing (autoindex on;). It appears to truncate the file names at around 50 characters. Is it possible to disable this so that it will...
