Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- nextjs
- S3
- fanzeel
- swift
- 웹뷰
- angular4
- 네이티브
- hybrid
- 카카오톡
- TypeScript
- AWS
- cors
- 페이스북
- Android
- Route53
- 감사일기
- node
- https
- 도메인
- JavaScript
- angular
- node.js
- beanstalk
- 안드로이드
- Elastic Beanstalk
- NeXT
- ios
- react
- php
- 알려줌
Archives
- Today
- Total
쪼렙 as! 풀스택
Elastic Beanstalk - Load Balancer- Node - Express 에서 https 로 redirect 시키기. 본문
개발 일지/AWS
Elastic Beanstalk - Load Balancer- Node - Express 에서 https 로 redirect 시키기.
코코앱 2018. 8. 1. 14:52빈스토크 - 로드밸런서를 쓰고 있는경우, http 인지 https 인지 구분하는 방법이 약간 특별해진다.
그 특별한 내용은 여기 참조...
Elastic Beanstalk 에서 HTTPS 로 Redirect 시키려 한 삽질들...
이번엔 Node - Express 서버에서 리다이렉트를 시켜본다.
const server = express()
server.use(function(req, res, next) {
const xForwrded = req.get('X-Forwarded-Proto') //로드밸런서경우, X-Forwarded-Proto 로, 어떤 요청으로 왔는지 알 수 있다.
if(!!xForwrded && xForwrded !== 'https') {
res.redirect('https://' + req.get('Host') + req.url);
return;
}
});
'개발 일지 > AWS' 카테고리의 다른 글
AWS - Beanstalk - Node.js - proxy 서버 사용하면서 static file 사용하기. (0) | 2018.11.06 |
---|---|
React-Next.js 프로젝트, AWS - Elastic Beanstalk 에 배포 삽질기. (1) | 2018.07.30 |
CloudFront - 새로고침(?) 최신 리소스로 갱신 Invalidation 하기. (1) | 2017.05.31 |
S3 - SDK(PHP) 로 사용하기 #2 - Object 업로드하기, 삭제하기. (0) | 2017.05.31 |
S3 - SDK(PHP) 로 사용하기 #1 - 안전하게 권한 설정하기. (0) | 2017.05.19 |
Comments