N
Nuxt2y ago
Phillip

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
3 Replies
Fabian B.
Fabian B.2y ago
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
Nuxt
server/
The server/ directory is used to register API and server handlers to your application.
Phillip
PhillipOP2y ago
@Fabian B. thank you so much!
Fabian B.
Fabian B.2y ago
No worries, glad it helped!
Want results from more Discord servers?
Add your server