728x90
반응형
Ngimx 간단한 설정 값 추가로 응답 리소스 사이즈를 줄일 수 있다.
*Tomcat 설정 시 미묘한 차이를 보여 Nginx로 교체
*자세한 설명 생략
▷ Nginx nginx.conf 설정
# Nginx worker 프로세스 수 설정
worker_processes 1;
# 에러 로그 파일 경로 및 로그 레벨 설정
#error_log logs/error.log notice;
# Nginx PID 파일 경로 설정
#pid logs/nginx.pid;
events {
# worker 프로세스 당 최대 연결 수 설정
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
# gzip 설정
# gzip 설정 활성화
gzip on;
# gzip 압축 최소 길이 설정
gzip_min_length 256;
# gzip 압축 레벨 설정
gzip_comp_level 6;
# gzip 적용할 MIME 타입 설정(와일드 카드 없음)
gzip_types
text/plain
text/css
application/json
application/javascript
text/xml
application/xml
application/xml+rss
text/javascript
application/font-woff
application/font-woff2
application/vnd.ms-fontobject
image/svg+xml;
# gzip vary 헤더 활성화
gzip_vary on;
# TEST
server {
# 서버 포트 설정
listen 8080;
# 서버 이름 설정
server_name TEST;
# 파일 위치 설정
location / {
root C:/nginx-1.24.0/webapp/배포파일;
try_files $uri $uri/ /index.html;
index index.html index.htm;
}
# 에러 페이지 설정
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
}
▷ 결과
▷ 관련 글
Tomcat Compression Gzip 설정
Tomcat7부터 간단한 설정 값 추가로 응답 리소스 사이즈를 줄일 수 있다.*설정은 했지만 크게 감소하지 않음*자세한 설명 생략 ▷ Tomcat Server.xml 설정*Connector 부분에 추가 compression="on" compressableM
coding-today.tistory.com
728x90
728x90
'▶ Back-End > Server' 카테고리의 다른 글
SNS 간편로그인 - 구글 API 사용 등록 방법 (0) | 2024.07.15 |
---|---|
SNS 간편로그인 - 카카오 API 사용 등록 방법 (0) | 2024.07.10 |
Tomcat Compression Gzip 설정 (0) | 2024.06.25 |
OpenSearch 검색어 자동 완성 설정 방법 + 한글 형태소 분석기(Nori) (0) | 2024.05.21 |
OpenSearch Dashboard Index Patterns 생성 (0) | 2024.05.20 |
댓글