서버 세팅 & tool/nginx

[nginx] API gateway

방푸린 2022. 3. 14. 15:40
반응형

 

api gateway란

  • api management tool sits between client and backend
  • reverse proxy
An API gateway is set up in front of the microservices and becomes the entry point for every new request being executed by the app. It simplifies both the client implementations and the microservices app.

 

기능들

  1. TLS termination
    • ssl /tls 1.3 지원
  2. client authentication
    1. auth_jwt 로 키고/켜고 가능
    2. auth_jwt_key_file 로 저장된 키파일(.jwk)불러올 수 있음
    3.  키가 유효하면 프록시 됨
  3. fine-grained access control
    1. jwt_claim_uid -> 토큰 안 uri 값 가져올 수 있음, 가져와서 더 상세한 조건으로 제한 가능
  4. request routing
    • uri별로 어디로 프록시할지 정할 수 있음
    • proxy_pass 와 =,~ 등을 이용한 정규식 사용 가능
  5. rate limiting
    • limit_req_zone
    • 속도 제한 가능(ex. 5r/m = 5requests per a minute); 사실 횟수 제한에 가까움
    • 이를 초과하면 limit_req_status로 설정해둔 status code가 response로 내려감
  6. load balancing

 

 

728x90
반응형