Prerequisite
-
해당 문서는 점검페이지로 Redirect 하는 방법을 안내합니다.
Process
점검페이지로의 리다이렉션을 설정할 ALB를 확인합니다.
해당 ALB 내 점검 페이지로 리다이렉션 룰을 적용할 Listener를 확인합니다.
아래 사항은 443 Listener 내 룰을 적용하는 예입니다.
Add rule 을 통해 점검 페이지로의 리다이렉션 룰을 적용합니다.
rule 의 Name 을 설정해줍니다.
Add condition 버튼을 눌러줍니다.
Add condition 에서 Host header 버튼을 눌러줍니다.
(만일 다중 호스트에 대한 서비스가 아니라면, 설정할 필요가 없습니다.)
추가로 Add condition 버튼을 눌러 Path 를 선택해 줍니다.
(다중 호스트가 아닌 경우, "*"를 적용해서 모든 요청 URI에 대해 룰이 적용되도록 합니다.)
Path 에 "*" 를 입력해줍니다.
설정 사항 확인 후 Next를 클릭합니다.
"Redirect to URL" 을 선택 후 HTTPS - 443 으로 설정합니다.
(점검페이지의 서비스 포트에 따라 달라질 수 있습니다.)
메인터넌스 페이지가 www.test.com/maintenance 일 경우
- Host에는 www.test.com
- Path에는 /maintenance 를 넣습니다.
- Query 값을 설정합니다. (필요에 따라 적용합니다.)
- Status Code 는 302 - Found 로 설정해줍니다.
(301로 적용할 경우, 포털에서의 싸이트 검색 시 점검페이지가 보여질 수 있습니다.)
Set rule priority의 경우, 가장 낮은 숫자로 설정해줍니다.
(순차 적용이므로 제일 상단의 룰에 매칭되도록 하기 위함입니다.)
Next 를 눌러 Create 버튼을 눌러주면 Rule 적용이 완료 됩니다.
Next 적용 이후 약 30초 이내 룰이 적용되어 점검페이지로의 리다이렉션 되는 것을 확인할 수 있습니다.
복구하는 방법은 다음과 같이 단순하게 룰을 제거하면 됩니다.
해당 rule 을 선택 후 Action - Delete rule 을 선택하면 됩니다.
Reference
https://repost.aws/ko/knowledge-center/elb-redirect-to-another-domain-with-alb
※스마일샤크가 제공하는 모든 콘텐츠는 관련 법의 보호를 받습니다. 스마일샤크 콘텐츠를 사전허가 없이 무단으로 복사·배포·판매·전시·개작할 경우 민·형사상 책임이 따를 수 있습니다. 콘텐츠 사용과 관련해 궁금한 점이 있으면 전화(☎: 070-4369-2028) 또는 이메일(contact@smileshark.kr)로 문의하기 바랍니다
댓글
댓글 0개
댓글을 남기려면 로그인하세요.