There does not seem to be a definitive answer to this. I have seen other questions posted here where people suggest using nginx
to proxy ssl and run the next
app as http
. I've also seen posts about --experimental-https
.
My use case:I have nginx
setup with ssl. However, I require next
to be launched with https
for the crypto module to work.
I tried adding --experimental-https
to my package.json
like such:
"scripts": {"dev": "next dev --turbopack --experimental-https","build": "next build","start": "next start --experimental-https","lint": "next lint","start:dev": "cross-env-shell ./node_modules/.bin/next dev" },
Running npm run dev
works a charm, enabling ssl support.
Doing a build and running npm run start
gives the error:
error: unknown option '--experimental-https'
So how would I actually launch next
with https
support in a production environment?