Nginx 의 제3자 모듈 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 시간) 입 니 다.
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
다양한 언어의 JSONJSON은 Javascript 표기법을 사용하여 데이터 구조를 레이아웃하는 데이터 형식입니다. 그러나 Javascript가 코드에서 이러한 구조를 나타낼 수 있는 유일한 언어는 아닙니다. 저는 일반적으로 '객체'{}...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.