Forum: NGINX Full Filename Directory Listing

Posted by mindfrost82 (Guest)
on 2010-08-27 20:38
(Received via mailing list)
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
Posted by fagtron (Guest)
on 2011-01-19 02:37
(Received via mailing list)
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
[b]src/http/modules/ngx_http_autoindex_module.c[/b] 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: 
http://forum.nginx.org/read.php?2,124400,167420#msg-167420
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.