-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Description
Describe the bug
After I migrated from vite 6 to vite 7.1.3 the proxy setting doesn't seem to work. i still haven't identified the reason.
from vite.config:
const getGraphProxy = (envVars: Record<string, string>) => ({
"/graphql": {
target: envVars.VITE_API_URL,
changeOrigin: true,
secure: false,
rewrite: () => "",
}
});
const serverConfig = (envVars: Record<string, string>): ServerOptions => ({
port: 9091,
strictPort: true,
allowedHosts: true,
open: true,
proxy: {
...getGraphProxy(envVars),
},
});
VITE_API_URL=https://someurl.com/graphql
vite 6 worked as expected, the request was made to localhost and was proxied to https://someurl.com. in vite 7 i got this in the browser:
Mixed Content: The page at 'https://localhost:9091' was loaded over HTTPS, but requested an insecure resource 'https://someurl.com/graphql'. This request has been blocked; the content must be served over HTTPS
can someone point me in the right direction? thanks
Reproduction
no url
Steps to reproduce
No response
System Info
-Used Package Manager
pnpm
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 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.