Module ngx_http_empty_gif_module

Module ngx_http_empty_gif_module The ngx_http_empty_gif_module module emits single-pixel transparent GIF. Example Configuration location = /_.gif { empty_gif; } Directives Syntax: empty_gif; Default: — Context: location Turns on module processing in a su

nginx.org

 

empty_gif 지시자

  • 주변 위치에서 모듈 처리를 켬
  • 문맥 : location
  • 사용 문법
      # 문법
      empty_gif;

 

 

empty_gif 예제 구성

  • 파일이 없는 경우 단일 픽셀 투명 GIF 전송할 수 있도록 설정
      location = /my_img {
        access_log off;
        empty_gif;
      }

 

 

'Nginx > Nginx 모듈 학습' 카테고리의 다른 글

ngx_http_image_filter_module 모듈  (0) 2023.09.21
ngx_http_gzip_static_module 모듈  (1) 2023.09.21
ngx_http_gunzip_module 모듈  (0) 2023.09.21
ngx_http_addition_module 모듈  (0) 2023.09.21
ngx_http_access_module 모듈  (0) 2023.09.20
 

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;

 

 

'Nginx > Nginx 모듈 학습' 카테고리의 다른 글

ngx_http_image_filter_module 모듈  (0) 2023.09.21
ngx_http_gzip_static_module 모듈  (1) 2023.09.21
ngx_http_gunzip_module 모듈  (0) 2023.09.21
ngx_http_empty_gif_module 모듈  (0) 2023.09.21
ngx_http_access_module 모듈  (0) 2023.09.20
 

Module ngx_http_access_module

Module ngx_http_access_module The ngx_http_access_module module allows limiting access to certain client addresses. Access can also be limited by password, by the result of subrequest, or by JWT. Simultaneous limitation of access by address and by password

nginx.org

 

  • ngx_http_access_module 모듈을 사용하면 특정 클라이언트 주소에 대한 액세스를 제한할 수 있음
  • password, result of subrequest 또는 JWT에 의해 액세스를 제한할 수도 있음
  • address와 password에 의한 동시 접근 제한(Simultaneous limitation of access)은 satisfy 지시어로 제어

  • 구성 예시
    location / {
        deny  192.168.1.1;
        allow 192.168.1.0/24;
        allow 10.1.1.0/16;
        allow 2001:0db8::/32;
        deny  all;
    }
  • rules은 첫 번째 일치 항목이 발견될 때까지 순차적으로 확인
  • 주소 192.168.1.1을 제외한 IPv4 네트워크 10.1.1.0/16 및 192.168.1.0/24와 IPv6 네트워크 2001:0db8::/32에 대해서만 액세스가 허용
  • 규칙이 많은 경우 ngx_http_geo_module 모듈 변수를 사용하는 것이 좋음

 

 

allow 지시자

  • 지정된 네트워크 또는 주소에 대한 액세스를 허용
  • 특수 값인 unix:(1.5.1)를 지정하면 모든 UNIX 도메인 소켓에 대한 액세스를 허용

  • 문맥 : http, server, location, limit_except
  • 사용 문법
    ## 문법
    allow address | CIDR | unix: | all;

 

 

deny 지시자

  • 지정된 네트워크 또는 주소에 대한 액세스를 거부
  • 특수 값인 unix:(1.5.1)를 지정하면 모든 UNIX 도메인 소켓에 대한 액세스를 거부

  • 문맥 : http, server, location, limit_except
  • 사용 문법
    ## 문법
    deny address | CIDR | unix: | all;

 

 

'Nginx > Nginx 모듈 학습' 카테고리의 다른 글

ngx_http_image_filter_module 모듈  (0) 2023.09.21
ngx_http_gzip_static_module 모듈  (1) 2023.09.21
ngx_http_gunzip_module 모듈  (0) 2023.09.21
ngx_http_empty_gif_module 모듈  (0) 2023.09.21
ngx_http_addition_module 모듈  (0) 2023.09.21

+ Recent posts