Web 目錄文件瀏覽配置

IIS 配置目錄瀏覽

在目錄下 Web.config 下添加一句:

<directoryBrowse enabled="true"/>
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <staticContent>
            <mimeMap fileExtension=".apk" mimeType="text/plain" />
        </staticContent>
        <directoryBrowse enabled="true"/>
    </system.webServer>
</configuration>


 

Nginx 配置目錄瀏覽

默認是禁止目錄瀏覽的

http {  
    autoindex on;   #開啓nginx目錄瀏覽功能
    autoindex_exact_size off;  #文件大小從KB開始顯示
    autoindex_localtime on;  #顯示文件修改時間爲服務器本地時間

    include       mime.types;
    default_type  application/octet-stream;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;

    #gzip  on;

    server {
        listen       9091;
        server_name  localhost;

        location / {
            root   html;
            index  index.html index.htm;
        }

        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        } 
    } 
}

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章