• Hi, Pleskians! We are running a UX testing of our upcoming product intended for server management and monitoring.
    We would like to invite you to have a call with us and have some fun checking our prototype. The agenda is pretty simple - we bring new design and some scenarios that you need to walk through and succeed. We will be watching and taking insights for further development of the design.
    If you would like to participate, please use this link to book a meeting. We will sent the link to the clickable prototype at the meeting.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • The ImunifyAV extension is now deprecated and no longer available for installation.
    Existing ImunifyAV installations will continue operating for three months, and after that will automatically be replaced with the new Imunify extension. We recommend that you manually replace any existing ImunifyAV installations with Imunify at your earliest convenience.

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