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?![No description](https://cdn.answeroverflow.com/1080140093366472824/Bildschirmfoto_2023-02-28_um_15.50.56.png)
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!