1.Nginx
In the Server segment of the corresponding project, in the location segment, add AutoIndex on. For example:
Server {Listen the; server_name www.dee.practise.com; Location/{root HTML/practise; #index index.php; AutoIndexon; } Location~\.php$ {#root html; Root HTML/practise; #fastcgi_pass127.0.0.1:9000; Fastcgi_pass Unix:/tmp/php-Cgi.sock; Fastcgi_index index.php; Fastcgi_param script_filename $document _root$fastcgi_script_name; Include Fastcgi_params; } Access_log/home/wwwlogs/practise/Access.log access; }
2.Apache
Add the following code to the http.conf (in the case of the D:/wamp/www/practise directory):
" d:/wamp/www/practise > #开启目录列表索引模式 Options Indexes Order allow,deny indexoptions namewidth= 8 charset=utf-to </Directory>
Or
<directory/>"d:/wamp/www/practise" #开启目录列表索引模式 Options Indexes Order allow,deny indexoptions namewidth= charset=utf-8 allow from all </Directory>
Reference:
Enable the Apache Directory browsing feature
Nginx and Apache Open Directory browsing function