Skip to content

How can I use Next.js over HTTPS instead of HTTP? #10935

Answered by agent1ve
m-abdelwahab asked this question in Help
Discussion options

You must be logged in to vote

The latest Next.js version release 13.5.1 has an experimental flag for the dev server to run over https.

See the release notes under "Other Improvements"

  • Update to latest Next.js via: npm i next@latest react@latest react-dom@latest eslint-config-next@latest
  • Update package.json script for "dev" to: next dev --experimental-https

Uses "mkcert" and stores certificates under your project root in a folder named "certificates" where it will store 2x certs: "localhost-key.pem" and "localhost.pem"

As a sanity test, I ran my local dev server with the --experimental-https flag and set an FB/Instagram App's OAuth callback value to "https://localhost:3000/api/auth/callback". Instagram provided the w…

Replies: 55 comments 128 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
9 replies
@mi-na-bot
Comment options

@skrenes
Comment options

@drewtwo
Comment options

@KorbisInc
Comment options

@steowens
Comment options

Comment options

You must be logged in to vote
6 replies
@abdulbasit010
Comment options

@Adrien-D
Comment options

@jackHedaya
Comment options

@cdpark0530
Comment options

@ken107
Comment options

Comment options

You must be logged in to vote
6 replies
@jaxomlotus
Comment options

@gl0gl0
Comment options

@abdulbasit010
Comment options

@tsongas
Comment options

@niedfelj
Comment options

Comment options

You must be logged in to vote
27 replies
@SomervilleTom
Comment options

@mi-na-bot
Comment options

@SomervilleTom
Comment options

@SomervilleTom
Comment options

@mi-na-bot
Comment options

Comment options

You must be logged in to vote
2 replies
@xtealer
Comment options

@steowens
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@astriskit
Comment options

@justyn-clark
Comment options

@Snouzy
Comment options

Comment options

You must be logged in to vote
1 reply
@gloyens
Comment options

Comment options

You must be logged in to vote
1 reply
@thebetterjort
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@mi-na-bot
Comment options

@steowens
Comment options

Comment options

You must be logged in to vote
7 replies
@justyn-clark
Comment options

@blainegarrett
Comment options

@theGOTOguy
Comment options

@hugotox
Comment options

@cdpark0530
Comment options

Comment options

You must be logged in to vote
1 reply
@SomervilleTom
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
8 replies
@mustafademiray1
Comment options

@SomervilleTom
Comment options

@patrickkeenan
Comment options

@jayachandra9
Comment options

@SomervilleTom
Comment options

Answer selected by leerob
Comment options

You must be logged in to vote
1 reply
@drscottlobo
Comment options

Comment options

You must be logged in to vote
1 reply
@SomervilleTom
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@VLahodnyi
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@mi-na-bot
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@jaj232
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet