📅  最后修改于: 2022-03-11 15:04:26.185000             🧑  作者: Mango
// Nuxt @ v2.15.6
// 1. Install redirectSSL
npm i redirect-ssl
// 2. Import package in nuxt.config.js
import redirectSSL from 'redirect-ssl';
// 3. Add redirect to nuxt.config.js (make sure you have environment variables in Heroku)
export default {
...
serverMiddleware: [
redirectSSL.create({enabled: process.env.NODE_ENV === 'production'})
],
...
}