Nginx/Nginx 모듈 학습
ngx_http_addition_module 모듈
hippo 데브옵스
2023. 9. 21. 00:07
- Nginx http addition 모듈 : Module ngx_http_addition_module (nginx.org)
Module ngx_http_addition_module
Module ngx_http_addition_module The ngx_http_addition_module module is a filter that adds text before and after a response. This module is not built by default, it should be enabled with the --with-http_addition_module configuration parameter. Example Conf
nginx.org
- ngx_http_addition_module 모듈은 응답 전후에 텍스트를 추가하는 필터
- ngx_http_addition_module 모듈은 기본적으로 빌드되지 않으며 --with-http_addition_module 구성 매개변수를 사용하여 사용하도록 설정
- 구성 예시
location / { add_before_body /before_action; add_after_body /after_action; }
add_before_body 지시자
- 지정된 하위 요청을 처리한 결과 반환된 텍스트를 응답 본문 앞에 추가
- 매개변수로 빈 문자열("")을 사용하면 이전 구성 수준(previous configuration level)에서 상속된 추가를 취소할 수 있음
- 문맥 : http, server, location
- 사용 문법
# 문법 add_before_body uri;
add_after_body 지시자
- 응답 본문 뒤에 지정된 하위 요청을 처리한 결과로 반환된 텍스트를 추가
- 매개변수로 빈 문자열("")을 사용하면 이전 구성 수준(previous configuration level)에서 상속된 추가를 취소함
- 문맥 : http, server, location
- 사용 문법
# 문법 add_before_body uri;
addition_types 지시자
- "text/html" 외에 지정된 MIME 유형의 응답에 텍스트를 추가할 수 있음
- 특수 값 "*"는 모든 MIME 유형(0.8.29)과 일치
- 문맥 : http, server, location, limit_except
- 사용 문법
# 문법 addition_types mime-type ...;
- 사용 예시
# 사용 예시 addition_types text/html;