brunch

You can make anything
by writing

C.S.Lewis

by Master Seo Jul 14. 2020

414. CloudFront , 동적 컨텐츠 가속

실습,php사이트제외




<1>  CloudFront 웹 분산 생성하기

<2> S3에   404 에러 페이지 올리기

<3> 웹배포 정의

<4> PHP 웹사이트 설정

<5> 웹사이트 접속




<1>  CloudFront 웹 분산 생성하기


CloudFront >  분산 생성하기 >  Web >  원본 도메인 이름 > 

ec2-54-149-73-198.us-west-2.compute.amazonaws.com


프로토콜 정책  > HTTP and HTTS (디폴트)

Allowed HTTP Methods  >  GET, HEAD, OPTIONS, PUT, POST, PATCH, DELETE 로 변경

Cache and origin request settings > Use legacy cache settings 로 변경

Object Caching : Customize 로 변경

Minimum TTL  0

Default TTL 86400 (하루)

Forward Cookies > ALL로 변경

Query String Forwarding and Caching > Forward all, cache based on all 로 변경

> Create Distribution

// 10분 소요




<2> S3에   404 에러 페이지 올리기


1

notepad

404Error.html


<html>

<body>

<h1>    404  Error !!!!!!!!!!!!!!!   </h1>

</body>

</html>



2

S3 > upload >  파일 올리기

파일클릭 > Actions > Make Public  




<3> 웹배포 정의


1

CloudFront  >   생성된 웹분산 체크 >  Distribution Setting > Behaviros 탭 >  Create Behavior  > Path Pattern

*.gif

Cache and origin request settings > Use legacy cache settings  로 변경

Object Caching   : Customize 로 변경

Create


2

Origins and Origin Groups  텝  >  Create  Origin >   오리진을 S3버킷으로 한다  > 

Restrict Bucket Access  : Yes로 변경 >   Create 


3

 Behaviros 탭 >  Create Behavior  > Path Pattern  

/Custom*ErrorPage.html

Origin or Origin Group > S3 버킷 >   Create 


4

Error Pages 탭 > Create Custom Error Response   >  404 : Not Found >   

Customize Error Response  : Yes로 변경 > 

Response Page Path

/404Error.html

HTTP Response Code

404:Notfound

Create



<4> PHP 웹사이트 설정


1

s3 URL 접속


2

CloudFront 

접속

http://ec2-54-149-73-198.us-west-2.compute.amazonaws.com/phpbb/



<5> 웹사이트 접속


CloudFront 

Distributions  >  상태  Deploy

http://ec2-54-149-73-198.us-west-2.compute.amazonaws.com/phpbb/




 감사합니다.


매거진의 이전글 413. S3로  홈페이지 만들기

작품 선택

키워드 선택 0 / 3 0

댓글여부

afliean
브런치는 최신 브라우저에 최적화 되어있습니다. IE chrome safari