이전에 URL을 입력 할 때 이것을 본 적이 있으면 http://test.com/test/html 페이지를 제공하는 대신 주어진 위치에있는 모든 파일을 탐색 할 수있는 인터페이스와 같은 ‘파일 브라우저’를 제공합니다.
위치 컨텍스트에서 사용할 수있는 nginx 모듈 일 수 있다고 생각합니다.
nginx.conf파일 :
worker_processes  1;
events {
    worker_connections  1024;
}
http {
    include       mime.types;
    default_type  application/octet-stream;
    sendfile        on;
    keepalive_timeout  65;
    server {
        listen       80;
        server_name  122.97.248.252;
                location /test {
                        root /home/yozloy/html/;
                        autoindex on;
                }
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
    }
}
업데이트 error.log
2012/05/19 20:48:33 [오류] 20357 # 0 : * 72 open () “/ home / yozloy / html / test”실패 (2 : 해당 파일 또는 디렉토리 없음), 클라이언트 : 125.43.236.33, 서버 : 122.97.248.252, 요청 : “GET / test HTTP / 1.1”, 호스트 : “unicom2.markson.hk
위치 /test의미 를 오해해야합니다. http://example.com/test를 입력했을 때 의미한다고 생각 하면 루트 사전에 액세스합니다./home/yozloy/html/
답변
HttpAutoindexModule을 시도해야합니다.
자동 색인 옵션을로 설정합니다 on. 기본적으로 꺼져 있습니다.
예제 구성이 정상이어야합니다.
location /{
   root /home/yozloy/html/;
   index index.html;
   autoindex on;
}
autoindex 옵션이 없으면 파일 /이없는 디렉토리에서로 끝나는 요청에 대해 오류 403 이 표시 index.html됩니다. 이 옵션을 사용하면 간단한 목록이 표시됩니다.
<html>
<head><title>Index of /</title></head>
<body bgcolor="white">
<h1>Index of /test/</h1><hr><pre><a href="../">../</a>
<a href="test.txt">test.txt</a>                 19-May-2012 10:43            0
</pre><hr></body>
</html>
편집 : 테스트 할 참조를 삭제하도록 목록을 업데이트했습니다 .
답변
1. 모든 디렉토리의 내용 나열
자동 색인 옵션을로 설정합니다 on. 기본적으로 꺼져 있습니다.
구성 파일 ( vi /etc/nginx/sites-available/default)은 다음과 같아야합니다.
location /{
   ... ( some other lines )
   autoindex on;
   ... ( some other lines )
}
2. 일부 특정 디렉토리의 내용 만 나열
자동 색인 옵션을로 설정합니다 on. 기본적으로 꺼져 있습니다.
구성 파일 ( vi /etc/nginx/sites-available/default) 
은 다음과 같아야합니다. 디렉토리 경로로 
변경path_of_your_directory
location /path_of_your_directory{
   ... ( some other lines )
   autoindex on;
   ... ( some other lines )
}
도움이 되었기를 바랍니다 ..
답변
모든 답변에는 답변의 일부가 포함됩니다. 모든 것을 하나로 결합 해 보겠습니다.
새로 설치된 nginx 서버의 빠른 설정 “파일 브라우저”모드 :
- 
nginx의 기본 구성을 편집합니다. sudo vim /etc/nginx/sites-available/default
- 
구성 섹션에 다음을 추가하십시오. location /myfolder { # new url path alias /home/username/myfolder/; # directory to list autoindex on; }
- 
거기에 폴더와 샘플 파일을 만듭니다. mkdir -p /home/username/myfolder/ ls -la >/home/username/myfolder/mytestfile.txt
- 
nginx 다시 시작 sudo systemctl restart nginx
- 
결과 확인 : http://<your-server-ip>/myfolder예 : http://192.168.0.10/myfolder/
답변
/home/yozloy/html/test폴더 생성이 필요 합니다. 또는 alias아래와 같이 사용할 수 있습니다 .
location /test {
    alias /home/yozloy/html/;
    autoindex on;
}
답변
나는 여러 번 시도했다.
그리고 마침내 나는 그냥 넣었 지만 외부에 넣었 autoindex on;습니다 . 괜찮습니다.httpserver
답변
이 섹션을 서버에 추가하십시오. location / {
location /your/folder/to/browse/ {
        autoindex on;
}
답변

