ngx_http_gzip_static_module

ngx_http_gzip_static_module 모듈을 사용하면 일반 파일 대신 “.gz” 파일 이름 확장자로 미리 압축된 파일을 전송할 수 있습니다.

이 모듈은 기본적으로 빌드되지 않고 –with-http_gzip_static_module 구성 매개변수로 활성화해야 합니다.

예제 구성

gzip_static on;
gzip_proxied expired no-cache no-store private auth;

Directives

Syntax:  gzip_static on | off | always;
Default: gzip_static off;
Context: http, server, location

사전 압축 파일 검사를 활성화(“on”)하거나 비활성화(“off”)합니다. 다음의 명령도 반영합니다.  gzip_http_version, gzip_proxied, gzip_disable 및 gzip_vary.

“always” 값(1.3.6)을 사용하면 gzip으로 압축된 파일은 클라이언트가 지원하는지 검사하지 않고 모든 경우에 사용됩니다. 디스크에 압축되지 않은 파일이 없거나 ngx_http_gunzip_module을 사용할 때 유용합니다.

이 파일은 gzip 명령이나 다른 호환되는 방법으로 압축할 수 있습니다. 원본과 압축된 파일의 수정 날짜와 시간이 동일한 것이 좋습니다.