문서의 선택한 두 판 사이의 차이를 보여줍니다.
다음 판 | 이전 판 마지막 판 양쪽 다음 판 | ||
nginx:basic_config [2012/11/09 15:10] kwon37xi 새로 만듦 |
nginx:basic_config [2020/06/03 16:43] kwon37xi |
||
---|---|---|---|
줄 1: | 줄 1: | ||
====== nginx 기본 설정 ====== | ====== nginx 기본 설정 ====== | ||
+ | * [[http:// | ||
* [[http:// | * [[http:// | ||
* [[nginx: | * [[nginx: | ||
+ | |||
+ | ====== 서버 정보 숨기기 ====== | ||
+ | * 응답으로 오는 Server 헤더에 nginx 정보가 들어간다. 이를 숨기는 것이 좋다. | ||
+ | * [[https:// | ||
+ | * 버전 번호만 삭제 < | ||
+ | // http, | ||
+ | server_tokens off; | ||
+ | </ | ||
+ | * '' | ||
+ | | ||
+ | |||
+ | </ | ||
+ | ====== timeout ====== | ||
+ | < | ||
+ | send_timeout 60s; # 요청을 보낸 후 응답을 받기까지 대기 시간. 이 설정상 최소 60초 이내에 응답이 와야한다. | ||
+ | </ | ||
+ | |||
===== error_page ===== | ===== error_page ===== | ||
줄 15: | 줄 33: | ||
error_page 404 =403 / | error_page 404 =403 / | ||
</ | </ | ||
+ | |||
+ | ===== Error Json ===== | ||
+ | * [[https:// | ||
+ | * '' | ||
+ | * [[https:// | ||
+ | < | ||
+ | error_page 500 /500.json; | ||
+ | location /500.json { | ||
+ | return 500 ' | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | |||
+ | ===== header/ | ||
+ | * [[http:// | ||
+ | * '' | ||
+ | * '' | ||
+ | < | ||
+ | expires | ||
+ | expires | ||
+ | expires | ||
+ | expires | ||
+ | expires | ||
+ | expires | ||
+ | add_header | ||
+ | </ | ||
+ | |||
+ | |||
+ | ===== real ip ===== | ||
+ | * 로드 밸런서 등을 사용할 때 실제 요청 IP가 변형되는 현상 방지 | ||
+ | * [[http:// | ||
+ | |||
+ | ===== Keep Alive ===== | ||
+ | * '' | ||
+ | keepalive_timeout 0; | ||
+ | </ | ||
+ | * '' | ||
+ | |||
+ | ===== default charset ===== | ||
+ | * 서빙하는 파일들에 기본 charset 헤더('' | ||
+ | < | ||
+ | # charset_types 에 charset을 자동으로 붙여줄 mime type들 추가. text/ | ||
+ | charset_types text/xml text/plain text/css application/ | ||
+ | charset UTF-8; | ||
+ | </ | ||
+ | |||
+ | ===== 참조문서 ===== | ||
+ | |||
+ | * [[http:// | ||
+ | * [[https:// |