티스토리 뷰
gzip 관련 설정 중에 gzip_static 이라는 옵션이 있다.
이 옵션은 정적 파일을 미리 gzip 압축해서 요청시 마다 압축하지 않고 미리 압축해둔 걸로 제공하는 기능이다.
설정법은 대략 아래와 같다.
gzip_static on;
그러나 설정하고 nginx -t 를 돌려보면 에러가 발생할 것이다.
이 기능을 사용하려면 ngx_http_gzip_static_module 을 설치해야 한다.
참고 : http://nginx.org/en/docs/http/ngx_http_gzip_static_module.html#gzip_static
NGINX 설치 또는 재설치
이 옵션을 설정하려면 NGINX를 재설치하여야 한다.
재설치시 ngx_http_gzip_static_module 도 설치되게 옵션을 지정해야 한다.
설정 스크립트는 이렇게..
./configure --prefix=/home/paint/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_secure_link_module --with-http_gzip_static_module
환경 설정
nginx.conf에서
gzip on;
gzip_static on;
gzip_types text/css
text/js
text/javascript
text/plain
text/xml
application/x-javascript
application/javascript
application/json
application/vnd.ms-fontobject
application/x-font-opentype
application/x-font-truetype
application/x-font-ttf
application/xml
application/xml+rss
font/eot
font/opentype
font/otf
image/svg+xml
image/vnd.microsoft.icon;
gzip_min_length 1000;
gzip_comp_level 5;
잘 동작하는지 확인법
strace -p [PID] 2>&1 | grep gz
'WEB,WAS > Web Server' 카테고리의 다른 글
| SSL Configuration Generator (0) | 2017.08.02 |
|---|---|
| [Nginx] 80포트의 모든 요청을 443포트로 리다이렉트하는 방법 (0) | 2017.01.25 |
| [NGINX] 설치 시 PCRE 오류 발생 시 대처 방법 (0) | 2017.01.24 |
| [NGINX] Nginx 명령어 (0) | 2017.01.24 |
| [Apache] 아파치 일반 계정으로 80 포트 서비스하는 방법 (0) | 2015.02.10 |
| [Apache/Tomcat] mod_jk 설치 (0) | 2014.03.19 |
| Apache - Tomcat 연동을 위한 mod_jk 컴파일하기 (0) | 2014.02.19 |
| [Apache] Apache 2.4 설치 (0) | 2014.02.19 |
- Total
- Today
- Yesterday
- groovy
- ssl
- rundeck
- 엔서블
- JVM
- vagrant
- Thread Dump
- rsync
- Nexus
- 엔시블
- Docker
- 파이프라인
- openssl
- 플레이북
- Shell Script
- Jenkins
- 쓰레드덤프
- Config History
- 리눅스
- Password manager
- PostgreSQL
- 젠킨스
- iTerm2
- Ansible
- Playbook
- 데브옵스
- Linux
- DevOps
- URL Encoding
- nginx
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | ||||||
| 2 | 3 | 4 | 5 | 6 | 7 | 8 |
| 9 | 10 | 11 | 12 | 13 | 14 | 15 |
| 16 | 17 | 18 | 19 | 20 | 21 | 22 |
| 23 | 24 | 25 | 26 | 27 | 28 | 29 |
| 30 |