Page 1 of 1

Nginx autoindex on (Directory Index)

Posted: Sun Jan 03, 2016 1:21 pm
by john_ukd
Hi all.

I have decided to reinstall my Vesta CP and use Nginx only. I'm just trying to get things back to how I had them with Apache.
I have a sub domain, lets say sub.domain.com and I would like autoindex on for this sub domain.
I have created a conf file at /home/admin/conf/web/nginx.sub.domain.com.conf containing:

Code: Select all

autoindex on;
autoindex_exact_size off;
This makes it work at http://sub.domain.com/test/ but when I go to just http://sub.domain.com I get a 404. I presume its looking for an index file.

How can I use the 'nginx.sub.domain.com.conf' include file to do this?

Cheers, John.

Re: Nginx autoindex on (Directory Index)

Posted: Thu Jan 07, 2016 12:07 pm
by Elizine
It seems like it was the symlink that was at fault here. When creating the symlink, use the full path instead of a relative path like so:

Code: Select all

ln -s /etc/nginx/sites-available/example.com /etc/nginx/sites-enable/example.com