본문 바로가기

react

next.js http header 적용하기

Strict Transport Security header 를 적용해 보자 !

# next.config.js

module.exports = {
  ...,
  async headers() {
    return [
      {
        source :'/(.*)',
        headers : [
          {
            key: 'Strict-Transport-Security',
            value: 'max-age=63072000;'
          }
        ]
      }
    ]
  }
}

https://nextjs.org/docs/api-reference/next.config.js/headers

반응형

'react' 카테고리의 다른 글

Failed to load env from ~  (0) 2022.08.08
big integer 를 응답으로 받아보자  (0) 2022.07.26
react-toastify - custom toast 적용하기  (0) 2022.07.15
emotion in next.js + typescript  (1) 2022.05.06
nextjs deployment with 644 permission  (0) 2022.01.01