작은숲:위키노트/Nginx 캐시 설정: 두 판 사이의 차이
보이기
잔글 Utolee90님이 위키노트:Nginx 캐시 설정 문서를 Nginx 캐시 설정 문서로 이동했습니다: Move_Pages_by_removing_the_text_위키노트_via_pywikibot |
잔글 문자열 찾아 바꾸기 - "분류:공유" 문자열을 "분류:위키노트/공유" 문자열로 |
||
| 15번째 줄: | 15번째 줄: | ||
* [http://aspyct.org/blog/2012/08/20/setting-up-http-cache-and-gzip-with-nginx/ Setting up HTTP cache and gzip with nginx] | * [http://aspyct.org/blog/2012/08/20/setting-up-http-cache-and-gzip-with-nginx/ Setting up HTTP cache and gzip with nginx] | ||
{{Nginx}} | {{Nginx}} | ||
[[분류:공유]] | [[분류:위키노트/공유]] | ||
[[분류:웹]] | [[분류:웹]] | ||
[[분류:서버]] | [[분류:서버]] | ||
[[분류:소프트웨어 설정]]{{퍼온문서|위키노트|{{#invoke:string|replace|{{PAGENAME}}|위키노트:|}}}}[[분류:위키노트에서 가져온 문서]] | [[분류:소프트웨어 설정]]{{퍼온문서|위키노트|{{#invoke:string|replace|{{PAGENAME}}|위키노트:|}}}}[[분류:위키노트에서 가져온 문서]] | ||
2021년 3월 28일 (일) 12:30 판
Nginx에서 트래픽을 줄이기 위해 고정 파일(static files, 그림 파일 등)을 웹 브라우저에 캐시하도록 하는 설정. 아래 설정은 server 블록, 즉 가상 호스트 설정 안에 들어가야 한다.
# static file caching for 1 week (7x24 hours)
#location ~* \.(css|js|gif|jpe?g|png|bmp|ico|svg)$ {
#expires 24h;
expires 7d;
add_header Pragma public;
add_header Cache-Control "public, must-revalidate, proxy-revalidate";
access_log off;
}location ~* \.(ico)$ {
log_not_found off;
}마지막 ico 파일에 대한 설정은 파일이 없는 경우 로그를 남기지 말라는 것이다.