-
-
Notifications
You must be signed in to change notification settings - Fork 7.2k
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Describe the bug
I'm trying to serve a Vue.js website from a Docker container using a custom domain and SSL cert. It looks like Vite is not serving the SSL cert and the browser is blocking the site with the error: NET::ERR_CERT_AUTHORITY_INVALID. This is because the browser is not receiving the provided SSL cert and is using the browser default example.org self signed cert.
This is currently working with Vue CLI using the same Docker image and run options.
Here are my Vite server settings:
host: '0.0.0.0',
port: 443,
https: {
key: readFileSync(ssl_key),
cert: readFileSync(ssl_cert)
},
proxy: {
'/socket.io': {
target: 'ws://mydomain.test',
ws: true
}
}
Server terminal output:
vite v2.9.9 dev server running at:
> Local: https://localhost:443/
> Network: https://172.17.0.2:443/
This is working with Vue CLI using the following:
port: 443,
host: '0.0.0.0',
https: true,
key: readFileSync(ssl_key),
cert: readFileSync(ssl_cert),
public: 'mydomain.test'
Vue CLI server terminal output:
App running at:
- Local: https://localhost:443/
- Network: https://mydomain.test/
Is there a way to change "Network" in Vite as we can in Vue CLI?
Reproduction
https://github.com/michaelalhilly/ViteCustomDomain
System Info
System:
OS: Linux 5.10 Debian GNU/Linux 10 (buster) 10 (buster)
CPU: (6) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
Memory: 6.78 GB / 7.77 GB
Container: Yes
Shell: 5.0.3 - /bin/bash
Binaries:
Node: 16.15.0 - /usr/local/bin/node
Yarn: 1.22.18 - /usr/local/bin/yarn
npm: 8.5.5 - /usr/local/bin/npm
npmPackages:
@vitejs/plugin-vue: ^2.3.1 => 2.3.3
vite: ^2.9.5 => 2.9.9
Used Package Manager
npm
Logs
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to https://github.com/vuejs/core instead.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request