반응형
프로젝트 오픈을 앞두고 인증서를 최신화 시킨 후 테스트를 해야하는 상황이 있었다.
이때에 로컬에서 먼저 테스트를 해보려고 했더니 http에서는 확인이 어려웠다(본인이 못한걸 수도 있다).
이참에 로컬에서 테스트를 할때에 https로 서버를 띄우는 방법을 알아보자
nuxt.config.js에 아래와 같이 설정을 해준다. __dirname에는 발급받은 인증서 경로를 뒤에는 인증서 이름을 입력하면 된다.
The server Property
Nuxt let you define the server connection variables for your application inside nuxt.config.js.
nuxtjs.org
nuxt.config.js
import path from 'path'
import fs from 'fs'
export default {
server: {
https: {
key: fs.readFileSync(path.resolve(__dirname, 'server.key')),
cert: fs.readFileSync(path.resolve(__dirname, 'server.crt'))
}
}
}
반응형
'WEB' 카테고리의 다른 글
Tomcat Error page 및 index page 수정 (0) | 2023.03.16 |
---|---|
[JavaScript] this 사용법 (0) | 2023.01.16 |
[VUE] compulsion rerendering (강제 렌더링 하기) (0) | 2022.11.24 |
[WEB][AJAX] Request method 'POST' not supported (0) | 2022.10.04 |
[JavaScript] new Promise를 활용해 비동기 콜백 만들기(axios) (0) | 2022.09.20 |