next.js - How do I launch nextjs app with https in production? - Stack Overflow

admin2025-04-18  3

I am writing a nextjs application. I need to launch it with https because the crypto module requires a secureContext. I have nginx setup with https to proxy requests to the nextjs app as https.

I have tried adding --experimental-https in my packages.json to the next start, but this gives the error:

error: unknown option '--experimental-https'

This flag only seems to work in dev mode.

I am writing a nextjs application. I need to launch it with https because the crypto module requires a secureContext. I have nginx setup with https to proxy requests to the nextjs app as https.

I have tried adding --experimental-https in my packages.json to the next start, but this gives the error:

error: unknown option '--experimental-https'

This flag only seems to work in dev mode.

Share Improve this question asked Jan 30 at 0:13 user29423378user29423378
Add a comment  | 

1 Answer 1

Reset to default 0

As long as your webserver handles https there is no need to make any next js modification to support it. As the error states, there is no --experimental-https option for next start

转载请注明原文地址:http://www.anycun.com/QandA/1744944062a89830.html