Minerman
Minerman
NNuxt
Created by Minerman on 2/13/2025 in #❓・help
connection is not secure, even after configuring https in nuxt.config.ts
Hi, I'm relatively new to nuxt. I'm attempting to enable https in my development environment. All tutorials I've seen refer to using localhost, but I'm developing on a local server so I'm not sure what to do differently. I've updated my system hosts file so example.com (here changed to obscure my exact setup) redirects to my development server. I've generated certificates using mkcert and updated my nuxt.config.ts with the following:
devServer: {
host: 'example.com',
https: {
key: fs.readFileSync(path.resolve(__dirname, 'example.com-key.pem')).toString(),
cert: fs.readFileSync(path.resolve(__dirname, 'example.com.pem')).toString(),
},
}
devServer: {
host: 'example.com',
https: {
key: fs.readFileSync(path.resolve(__dirname, 'example.com-key.pem')).toString(),
cert: fs.readFileSync(path.resolve(__dirname, 'example.com.pem')).toString(),
},
}
Running nr dev successfully starts the server on https://<ip-address>:3000/ which I can connect to, but my browser flags the site as an insecure connection. I am not sure what else to look at or reconfigure to fix this, so any advice is welcome.
24 replies