0

I have followed this article https://web.dev/how-to-use-local-https/ to do the steps required to run Next app over HTTPS.

In short these are the steps:

Brew install mkcert
mkcert -install
mkcert localhost
Then add certs to run script  "dev": "HTTPS=true SSL_CRT_FILE=localhost.pem SSL_KEY_FILE=localhost-key.pem next dev"

Completing these steps and running the app still serves over HTTP only.

npm run dev: `

web@0.1.0 dev HTTPS=true SSL_CRT_FILE=localhost.pem SSL_KEY_FILE=localhost-key.pem next dev

  • ready started server on 0.0.0.0:3000, url: http://localhost:3000 `

How do I force it to run over HTTPS?

Nex
  • 92
  • 9

0 Answers0