当前位置: > Linux服务器 > nginx >

Nginx浏览本地目录设置

时间:2015-12-01 18:56来源:linux.it.net.cn 作者:IT

老是记不住,干脆放在这里记录下来。

 

 

 
  1. server {  
  2.     listen       81;  
  3.     server_name  localhost;  
  4.   
  5.     location = /favicon.ico {  
  6.         log_not_found off;  
  7.         log_subrequest off;  
  8.     }  
  9.   
  10.   
  11.     location ^~ /log {  
  12.         alias /home/dist;  
  13.         autoindex on;  
  14.         autoindex_exact_size off;  
  15.         autoindex_localtime on;  
  16.     }  
  17. }  
server {
    listen       81;
    server_name  localhost;

    location = /favicon.ico {
        log_not_found off;
        log_subrequest off;
    }


    location ^~ /log {
        alias /home/dist;
        autoindex on;
        autoindex_exact_size off;
        autoindex_localtime on;
    }
}

参考:

http://nginxlibrary.com/enable-directory-listing/

(责任编辑:IT)
------分隔线----------------------------
栏目列表
推荐内容