Skip to content

NCUBE.NET

  • Life Log
  • Cycling Log
  • Photo Log
    • Portrait
    • Landscape
    • Flower
    • Etc
  • Coding Log
  • Information

NGINX gzip 압축 설정

2020-08-14 by 편리
Pixabay로부터 입수된 Mike Foster님의 이미지 입니다.

최근에 LiteSpeed 플러그인 등을 설치한 후 간혹 구글 페이지스피드 점수를 체크해보는 데 js 파일이 압축되어 전송되지 않는다고 해서 관련 설정을 살펴보게 됐다. 몇 년전에 gzip 압축 설정을 했던 것으로 기억하는데.. 아마도 제대로 설정을 하지 않았던 모양이다. 아니면 그새 뭔가 변경됐는데 내가 알지 못했거나..

nginx.conf 파일에 위 이미지와 같이 gzip 설정을 추가한 후 설정을 다시 로드해 주면 된다. 우분투 18.04 환경에서는 service nginx reload 를 실행하면 된다. 아래는 gzip 관련 설정이다.

        gzip on;
        gzip_disable "msie6";

        gzip_vary on;
        gzip_proxied any;
        gzip_comp_level 6;
        gzip_buffers 16 8k;
        gzip_http_version 1.1;
        gzip_min_length 256;
        gzip_types
            text/css
            text/javascript
            text/xml
            text/plain
            text/x-component
            application/javascript
            application/json
            application/xml
            application/rss+xml
            font/truetype
            font/opentype
            application/vnd.ms-fontobject
            image/svg+xml;

Post navigation

Previous Post:

워드프레스 5.5 업데이트

Next Post:

워드프레스 애니메이션 gif 파일을 mp4로 변환하여 출력하기

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Recent Posts

  • Windows 10 메모장의 재미난 기능
  • Windows 10 iCloud 사진 저장 폴더 변경
  • VS Code에서 git 히스토리 표시 오류
  • Windows 10 iTunes 백업 폴더 변경
  • Apache 서버에서 htaccess 파일 여러 개 지정하기
  • CentOS 7에서 Apache SELinux 설정
  • PSR 코딩을위해 VS Code 에 php-cs-fixer 적용
  • Instagram Basic Display API 연동
  • phpMyAdmin에서 root 로그인이 불가능한 경우 해결법
  • Ubuntu20.04 에서 PHP8 업그레이드

Recent Comments

  • 편리 on [PHP] HTTP와 PHP를 이용한 html5 video 스트리밍 구현
  • Kim on [PHP] HTTP와 PHP를 이용한 html5 video 스트리밍 구현
  • 편리 on 워드프레스 애니메이션 gif 파일을 mp4로 변환하여 출력하기
  • 고맙습니다 on 워드프레스 애니메이션 gif 파일을 mp4로 변환하여 출력하기
  • 편리 on PHPMailer를 이용한 이메일 발송
  • 초보자 on PHPMailer를 이용한 이메일 발송
  • 편리 on PHPMailer를 이용한 이메일 발송
  • 초보자 on PHPMailer를 이용한 이메일 발송
  • 편리 on 워드프레스 굿스플로 알림톡 플러그인 개발
  • 남민기 on 워드프레스 굿스플로 알림톡 플러그인 개발

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org
© 2021 NCUBE.NET | Built using WordPress and SuperbThemes