• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Resolved Apache + NGINX+ Direcotry Listing

UweP

Regular Pleskian
Hi, I have a problem. I have a .htaccess and want to serve a directory listing as is. Now, nginx seems to block this. I have an .htaccess etc. and before i was usin nginx (switched server - now with nginx) it worked that apache showed me the directory. now since i chagned the os of the system, ubuntu and am using apache + nginx, it says:

403 Forbidden

nginx

Can someone help me?

Thank you very much! Uwe
 
Hi UweP,

to enable a directory listing for nginx, you have to use the additional setting, as for example:

Code:
location /webroot_path_where_the_directory_listing_is_allowed {
autoindex on;
}
 
Thank you! I just don't know where the configs for nginx are. Also, the location would be / at vhost stuff.mydomain.tld. how do i set this?
 
ok, so in the vhost config for stuff.mydomain.tld i wanna have directory listing. i get this:
Invalid nginx configuration: nginx: [emerg] duplicate location "/" in /var/www/vhosts/system/stuff.freakyonline.de/conf/vhost_nginx.conf:1 nginx: configuration file /etc/nginx/nginx.conf test failed

if i add this:

location / {
autoindex on;
}
inside the vhost stuff.freakyonline.de.

how can i get stuff.mydomain.tld/ to do a directory listing.
 
ah i got it working by leaving out location / { } just by adding autoindex on;
 
how can I add fancy index module for nginx? is there an easy way like just selecting the module somewhere and enable it inside plesk?
 
Hi UweP,

bad idea:
by leaving out location /
You normally don't want this feature at ALL locations for a specific (sub)domain, which you will get, when you leave out the location - definition, as you did. ;)
 
oh well in this case - i might want that. because it's just a subdomain for files to download, and look at. also in its subdirectories. and this from the directory. but what do i do if i just want location /?
 
oh in ubuntu nginx-extras would be the package for nginx-fancyindexing but:
Unpacking nginx-extras (1.10.0-0ubuntu0.16.04.4) ...
dpkg: error processing archive /var/cache/apt/archives/nginx-extras_1.10.0-0ubuntu0.16.04.4_amd64.deb (--unpack):
trying to overwrite '/usr/sbin/nginx', which is also in package sw-nginx 1.11.4.1-ubuntu16.04.16100518
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Processing triggers for man-db (2.7.5-1) ...
Errors were encountered while processing:
/var/cache/apt/archives/nginx-common_1.10.0-0ubuntu0.16.04.4_all.deb
/var/cache/apt/archives/nginx-extras_1.10.0-0ubuntu0.16.04.4_amd64.deb
N: Ignoring file 'plesk.list.ai_back' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension
E: Sub-process /usr/bin/dpkg returned an error code (1)

hm :(
 
Hi UweP,

how can I add fancy index module for nginx? is there an easy way like just selecting the module somewhere and enable it inside plesk?
nope, there isn't an "easy" way. Additional NGINX modules have to be compiled in order to be able to use. To list the current compiled modules, you could use the command ( over the command line, logged in as user "root" ):

nginx -V
 
Hi UweP,

but what do i do if i just want location /?
As I previously stated, it IS a bad idea to "autoindex" all locations for a (sub)domain - no matter for what reason. Consider to use folders and sub-folders, where "autoindex" can be explizit allowed as suggested above, but don't use the webroot. ;)
 
hm, but i wont put anything else on the vhost (subdomain) ... maybe i should use a directory listing script or something then? .. thats maybe better?
 
hm well i dont like the idea of a directory listing script ... now i dont know ... i guess ill just keep the autoindex on; ... its just on that subdomain where i want all contents of all directories listed anyway.
 
Back
Top