상세 컨텐츠

본문 제목

AWS Cloudfront 기능 파악

Frontend

by 크리두 2020. 3. 30. 16:19

본문

반응형

AWS Cloudfront 기능을 정리해서 nginx 기반으로 같은 기능을 하기 위한 서버를 만드려고 한다.

Userportal 사이트를 만드려다 보니 되는 기능과 안되는 기능이 있는지 기능 정리 중...

 

cloud front 기능 설명

https://aws.amazon.com/ko/cloudfront/features/?nc=sn&loc=2https://aws.amazon.com/ko/cloudfront/features/?nc=sn&loc=2

 

콘텐츠 전송 네트워크의 주요 기능 | 성능, 보안 | Amazon CloudFront

 

aws.amazon.com

 

첫 화면에서 아래 그림의 빨간색 create distribution을 클릭한다.

aws cloud front 화면

 

Cloudfront delivery method 선택 화면

 

위와 같이 web을 사용하기 위해 get started를 선택한다.

다음 화면으로 넘어가면 아래와 같이 필요한 기능과 설정 값을 넣는 화면이 나온다.

 

cloudfront 설정 화면

 

< Origin Settings >

 

AWS CloudFront Origin Settings 화면

항목 설명 nginx 비교 모듈 참고
Origin Domain Name 도메인 이름 설정

server_name에 해당

virtual host 이름 설정

   
Origin Path 도메인 하위의 오리진 경로 origin path 설정    
Minimum Origin SSl Protocol TLS, SSL 버전 설정 ssl_protocols 설정 ngx_http_ssl_module http://nginx.org/en/docs/http/ngx_http_ssl_module.html
Origin Protocol Policy

http, https 설정

match Viewer 기능

-> Match Viewer를 지정하는 경우, CloudFront에서는 최종 사용자 요청의 프로토콜을 사용하여 오리진 서버에 요청을 전달합니다. 최종 사용자가 HTTP 및 HTTPS 프로토콜 모두를 사용하여 요청하더라도 CloudFront에서는 한 번만 객체를 캐싱합니다.

Match Viewer 기능 확인 필요

-> 현재는 80, 443 모두 설정하면 요청하는걸로 가는걸로 파악

   
Origin Response Timeout

오리진 응답 기다리는 시간

4-60초 설정

proxy_connect_time 설정 ngx_proxy_module http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_connect_timeout
Origin Keep-alive Timeout 세션 연결 유지 시간 설정 add_header Keep-Alive timeout ngx_http_upstrem_module http://nginx.org/en/docs/http/ngx_http_upstream_module.html#keepalive
Origin Custom Headers 오리진에 전달하는 헤더 이름 및 값 지정

add_header

- HTTP Head Control에서 가능

   

 

Cache Behavior Settings

 

< Default Cache Behavior Settings >

항목 설명 nginx 비교 모듈 참고
Viewer Protocol policy http, https, redirect 설정 listen 80 또는 443 ssl, redirect 설정    
Allowed HTTP Methods GET, HEAD, OPTIONS, PUT, POST, PATCH, DELETE

- HTTP Head Control

request_method를 통해 설정 가능

ngx_http_module http://nginx.org/en/docs/http/ngx_http_core_module.html
Field-level Encryption Config        
Cached HTTP Methods GET, HEAD 요청 캐쉬 default 설정      
Cache Based on Selected Request Header

None, Whitelist, all로 설정

 

geo로 변수 설정으로 가능

(ACL 접근제어 기능)

   
Object Caching

- Use Origin Cache Headers

오리진 캐시 헤더 정보를 이용

- Customize

헤더 등 필요한 기능 설정해서 사용

proxy_ignore_headers 등으로 customize 가능

  https://www.nginx.com/blog/nginx-caching-guide/
Minimum TTL

Minimum TTL interacts with HTTP headers such as Cache-Control max-age, Cache-Control s-maxage, and Expires and with Default TTL and Maximum TTL.

add_header Cache-Control "public", max-age=2592000;

  https://www.keycdn.com/support/cache-control
Maximum TTL

최대 Time To Live

상위와 같이 조절 가능

   
Default TTL

디폴트 TTL 설정

상위와 같이 조절 가능

   
Forward Cookies

쿠키값 포워딩

가능

   
Query String Forwarding and Caching

3가지 옵션 선택하여 기능

-None

- Forward all, cache based on whitelist

- Forward all, cache based on all

QueryString 포워드

   
Smooth Streaming

origin Microsoft IIS 사용하는 경우 smooth streaming 사용 가능

origin 

   

Restrict Viewer Access

(Use Signed URLs or Signed Cookies)

Sigend url 또는 cookie를 이용한 접근 제한

signed key 이용해서 가능

   
Compress Objects Automatically

- yes 선택하면 자동으로 compress 됨

Accept-Encoding: gzip

accept-encoding 추가 하면 가능

   
Lambda Function Associations

 

기능 없음

   

 

Distribution Setting 화면

 

< Distribution Setting >

 

항목 설명 nginx 비교 모듈 참고
Price Class 서비스 지역 설정 caching 서버 위치    
AWS WAF Web ACL WAF라는 방화벽 설정 사용      
Alternate Domain Names custom domain 설정 vhost 설정    
SSL Certificate

SSL 인증

- Default

- Custom

ssl 인증키 사용하면 됌

default, custom 2가지 가능

   
Supported HTTP Version

- http/2, http/1.1, http/1.0

- http/1.1, http/1.0

http2 conf에 설정 가능    
Default Root Object

root 폴더에서 index.html과 같은 파일 설정

location 블럭 내 root 폴더 설정 가능    
Logging

로그 파일 설정

- on/off 선택 가능

- cookie 로깅 선택 가능

     
Enable IPv6

IP version6 사용 여부

     
Comment

생성한 distribution 설명 입력 가능

    nginx가 아닌 관리페이지에 기능 넣으면 될것
Distribution State

- Enabled / Disabled 선택 가능

    nginx가 아닌 관리페이지에 기능 넣으면 될것

 

반응형

'Frontend' 카테고리의 다른 글

nodejs 설치 및 설정  (0) 2021.12.05
Djago(장고) + mariaDB  (0) 2020.02.01

관련글 더보기

댓글 영역