작은숲:위키노트/Nginx 압축 전송 설정: 두 판 사이의 차이
잔글 (판 1개를 가져왔습니다: 위키노트(http://wiki.mooo.org/)에서 가져옴) |
잔글 (Utolee90님이 Nginx 압축 전송 설정 문서를 작은숲:위키노트/Nginx 압축 전송 설정 문서로 이동했습니다: 제목 변경) |
||
| (같은 사용자의 중간 판 11개는 보이지 않습니다) | |||
| 1번째 줄: | 1번째 줄: | ||
[[위키노트 | [[작은숲:위키노트/Nginx|Nginx]]에서 압축 전송을 하려면 <tt>http</tt> 블록에 아래 내용을 추가한다. | ||
< | <syntaxhighlight lang="nginx"> | ||
# enable gzipping of responses | # enable gzipping of responses | ||
#gzip on; | #gzip on; | ||
| 14번째 줄: | 14번째 줄: | ||
image/svg+xml; | image/svg+xml; | ||
gzip_disable "MSIE [1-6]\.(?!.*SV1)"; | gzip_disable "MSIE [1-6]\.(?!.*SV1)"; | ||
</ | </syntaxhighlight> | ||
<tt>gzip_types</tt> 지시자의 기본값은 <code>text/html</code>이다. <tt>gzip_types</tt> 지시자에 값을 설정하면 Nginx는 기본값인 <code>text/html</code>에 설정한 값을 추가해서 지정한다. 그래서 <tt>gzip_types</tt> 지시자를 설정할 때 <code>text/html</code>를 넣으면 오류가 나온다. | <tt>gzip_types</tt> 지시자의 기본값은 <code>text/html</code>이다. <tt>gzip_types</tt> 지시자에 값을 설정하면 Nginx는 기본값인 <code>text/html</code>에 설정한 값을 추가해서 지정한다. 그래서 <tt>gzip_types</tt> 지시자를 설정할 때 <code>text/html</code>를 넣으면 오류가 나온다. | ||
== 참고 == | == 참고 == | ||
| 20번째 줄: | 20번째 줄: | ||
* [http://stackoverflow.com/questions/6475472/duplicate-mime-type-text-html Duplicate MIME type "text/html"?] | * [http://stackoverflow.com/questions/6475472/duplicate-mime-type-text-html Duplicate MIME type "text/html"?] | ||
{{Nginx}} | {{Nginx}} | ||
[[분류:공유]] | [[분류:위키노트/공유]] | ||
[[분류:웹]] | [[분류:위키노트/웹]] | ||
[[분류:서버]] | [[분류:위키노트/서버]] | ||
[[분류:소프트웨어 설정]][[분류:위키노트에서 가져온 문서]] | [[분류:위키노트/소프트웨어 설정]]{{퍼온문서|위키노트|{{#invoke:string|replace|{{PAGENAME}}|위키노트:|}}}}[[분류:위키노트에서 가져온 문서]] | ||
2022년 5월 7일 (토) 15:22 기준 최신판
Nginx에서 압축 전송을 하려면 http 블록에 아래 내용을 추가한다.
# enable gzipping of responses
#gzip on;
gzip_min_length 1100;
gzip_http_version 1.1;
gzip_vary on;
gzip_comp_level 6;
gzip_proxied any;
gzip_buffers 16 8k;
gzip_types text/plain text/css
application/json application/javascript
text/xml application/rss+xml application/atom+xml
image/svg+xml;
gzip_disable "MSIE [1-6]\.(?!.*SV1)";
gzip_types 지시자의 기본값은 text/html이다. gzip_types 지시자에 값을 설정하면 Nginx는 기본값인 text/html에 설정한 값을 추가해서 지정한다. 그래서 gzip_types 지시자를 설정할 때 text/html를 넣으면 오류가 나온다.