How to enforce redirecting to HTTPS?
I want to enforce HTTPS on a production environment (e.g. process.environment === 'prod'). I installed the
redirect-ssl
package but I'm not sure how to add it. I thought of serverMiddleware in the nuxt.config.ts but it's strike through. Any ideas?3 Replies
Hi, check the docs on middleware. In nuxt 3, you don't have to define it in the config anymore. https://nuxt.com/docs/guide/directory-structure/server#server-middleware
@Fabian B. thank you so much!
No worries, glad it helped!