티스토리 뷰
반응형
서비스를 오픈할 경우 https가 표준이 되면서 간혹 http로 접근하는 사용자들이 불편을 느끼지 않게 하기 위한
https로 redircet 해주는 기능이다.
const domain = "www.myTestDomain.or.kr";
/*http로 접속시 https로 redirect */
app.use(function (req, res, next) {
if (!req.secure) {
res.redirect(`https://${domain}${req.url}`);
} else {
next();
}
});
webServer로 사용하는 express 상단에 이렇게 적어주면 https로 redirect됩니다.
반응형
'Server' 카테고리의 다른 글
[node.js] excel 파일 생성 (0) | 2022.05.06 |
---|---|
[node.js] base 64 이미지 decode 및 저장 방법 (0) | 2022.05.04 |
[Express] session mySQL에 저장하기 (0) | 2022.05.03 |
[Express] bcrypt 을 사용한 비대칭 암호화, password 비대칭 암호화 (0) | 2021.11.12 |
[Express] schedule , 특정 시간 마다 이벤트 처리 (0) | 2021.11.12 |
댓글
반응형
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- reack-cookies #아이디 저장하기 #react 아이디 저장 #react cookie #리엑트 아이디 저장하기
- mysql date between # mysql date between 대소 비교 연산자
- Mac docker.for.mac.host.internal
- React filter #js Includes #React Filter includes
- PDF #pdfkit
- Swal #sweetalert2 #alert #알림창 띄우기 #react swal
- 이미지 전송 # 이미지 업로드 #이미지 여러장 #이미지 여러장 업로드 #react 이미지 업로드 #react 이미지 여러장 업로드
- mysql date
- mysql date between performance
- see ec2 instance connect prerequisites at https://docs.aws.amazon.com/awsec2/latest/userguide #인스턴스 연결 안됨
- linux/amd64/v2
- Express multer #Express File 저장 #node.js
- docker mysql
- BOJ #JS
- Procedure #mysql #mysql Procedure #mysql 반복문 #Procedure 반복문 #mysql insert 반복문
- docker # docker build # m1 docker build
- ERROR: failed to solve: no support for running processes with linux/amd64/v3 platform
- node.js #node.js pdf만들기 #node.js pdfkit
- excel 파일 만들기 #node.js #express excel 파일 만들기 #데이터 입력해서 excel 파일 만들기
- PoolCluster : Error: connect ECONNREFUSED 127.0.0.1:3306)
- JavaScript #Programmers #lvl2 #프로그래머스 오픈채팅방 # 오픈채팅방 문제
- Pytorch #Yolov5 #Segementation
- mysql date type
- ec2 instance connect is unable to connect to your instance. ensure your instance network settings are configured correctly for ec2 instance connect. for more information
- supported: linux/amd64
- FormData #FormData 파일전송 #FormData append json # React FormData File #React FormData append Json
- node.js 파일 저장
- react #react-spinners #modal loading #overlay #로딩창 #react 로딩창 만들기
- AWS #인바운드 #SSH #인스턴스 연결
- react #img 전송
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
글 보관함