Nginx 의 제3자 모듈 ngx - fancy index 설치

4118 단어
1. ngx - fancy index 모듈 의 소개:
     Nginx 웹 서버 가 자체 적 으로 가지 고 있 는 디 렉 터 리 탐색 기능 은 그다지 아름 답지 않 습 니 다. 우 리 는 ngx - fancy index 플러그 인 을 사용 하여 디 렉 터 리 탐색 기능 을 미화 할 수 있 습 니 다.
     우리https://github.com/aperezdc/ngx-fancyindex ngx - fancyindex 다운로드
2. nginx 가 설치 되 지 않 은 상태 에서 nginx 제3자 모듈 을 설치 합 니 다.
    #tar xf nginx-1.8.0.tar.gz 
    #unzip ngx-fancyindex-master.zip
    #cd nginx-1.8.0/
    # ./configure  --prefix=/usr/local/nginx --with-http_stub_status_module  --with-http_image_filter_module  --user=nginx --group=nginx --with-http_ssl_module --add-module=../ngx-fancyindex-master
PS: -- add - module = 제3자 모듈 의 압축 해제 디 렉 터 리 경로
     #make && make install
3. nginx 가 설 치 된 상태 에서 ngx - fancy index 모듈 을 설치 합 니 다.
     #tar xf nginx-1.8.0.tar.gz 
     #unzip ngx-fancyindex-master.zip
     #cd nginx-1.8.0/
     # ./configure  --prefix=/usr/local/nginx --with-http_stub_status_module  --with-http_image_filter_module  --user=nginx --group=nginx --with-http_ssl_module --add-module=../ngx-fancyindex-master
      #make                                                         ##설치 하지 마 세 요.
      #cp /objs/nginx  /usr/local/nginx/sbin/     ##다시 컴 파일 한 nginx 파일 을 nginx 원래 설치 디 렉 터 리 에 복사 합 니 다.
PS:  nginx 를 설치 한 제3자 모듈 은 실제로 사용 합 니 다. - add - module 은 nginx 를 다시 설치 합 니 다. make 하지 마 십시오. 인 스 톨 은 컴 파일 디 렉 터 리 아래 obbs / nginx 파일 을 오래된 nginx 파일 로 직접 덮어 씁 니 다. 여러 개의 nginx 제3자 모듈 을 설치 하려 면 해당 하 는 -- add - module 만 몇 개 더 지정 하면 됩 니 다. 다시 컴 파일 할 때 이전에 컴 파일 한 모듈 을 configure 매개 변수 에 추가 해 야 합 니 다.
       nginx 는 매우 많은 nginx 제3자 모듈 을 제공 하여 설치, 주 소 를 제공 합 니 다.http://wiki.nginx.org/3rdPartyModules
4. ngx - fancyindex 설정
location  /ftp  {
         fancyindex on;
         fancyindex_exact_size off;
         fancyindex_localtime on;
         fancyindex_footer   "footer.html";
         auth_basic            "Restricted";
         auth_basic_user_file  "/etc/nginx/.htpasswd";
}

       fancyindex on:  fancyindex 색인 을 열 지 여부       fancyindex_exact_size of:: 정확 한 크기 를 사용 하지 않 고 반올림 을 사용 하면 1.9M 이 2M 으로 표 시 됩 니 다. 켜 면 단 위 는 바이트 입 니 다.       fancyindex_localtime on:  로 컬 시간 사용 하기       fancyindex_footer "footer.html":  현재 경로 아래 footer. html 내용 을 아래쪽 으로 합 니 다.
fancy 명령 사용:
       fancyindex
       문법: * fancyindex * [* on * | * off *]
       기본 값: fancy index off       설정 블록: http, server, location       설명: 디 렉 터 리 인덱스 기능 열기 / 닫 기
       fancyindex_css_href
       문법: * fancyindexcss_href uri*       기본 값: fancy indexcss_href ""       설정 블록: http, server, location       설명: 외부 css 경로, 이 css 는 기 존의 css 스타일 을 대체 합 니 다.
      fancyindex_exact_size
      문법: * fancyindexexact_size* [*on* | *off*]      기본 값: fancy indexexact_size on      설정 블록: http, server, location      설명: 파일 의 크기 를 표시 하 는 방법 을 정의 합 니 다. 기본 값 은 on, on: 파일 크기 는 정확 한 값 을 사용 합 니 다. 단 위 는 바이트 입 니 다. of: 단 위 는 KB, MB, GB 입 니 다. 소수점 이 있 으 면 반올림 합 니 다.예 를 들 어 1.9MB 는 2MB 로 표 시 됩 니 다.
     fancyindex_footer
     문법: * fancyindexfooter path*     기본 값: fancy indexfooter ""     설정 블록: http, server, location     설명: 색인 페이지 의 아래쪽 에 파일 을 삽입 할 지 지정 합 니 다.
     fancyindex_header
     문법: * fancyindexheader path*     기본 값: fancy indexheader ""     설정 블록: http, server, location     설명: 색인 페이지 의 머리 에 어떤 파일 을 삽입 할 지 지정 합 니 다. 용법 과 fancy indexfooter 유사
     fancyindex_ignore
     문법: * fancyindexignore string1 [string2 [… stringN]]*     기본 값: 기본 값 이 없습니다.     설정 블록: http, server, location     설명: 어떤 파일 / 디 렉 터 리 가 숨겨 져 있 습 니까? nginx 가 정규 를 지원 한다 면 정규 표현 식 으로 걸 러 낼 수 있 습 니 다.
     예 를 들 어 dir 가 시작 하 는 파일 이나 디 렉 터 리, 파일 file1. txt 를 숨 기 고 싶 습 니 다. 설정 은 다음 과 같 습 니 다.     fancyindex_ignore "dir*" "file1.txt"
     fancyindex_localtime
     문법: * fancyindexlocaltime* [*on* | *off*]     기본 값: fancy indexlocaltime off     설정 블록: http, server, location     설명: 파일 생 성 시간 을 현지 시간 으로 표시 합 니 다. 기본 값 은 off (GMT 시간) 입 니 다.      
     

좋은 웹페이지 즐겨찾기