Fix Vite allowedHosts blocking production domains
Set allowedHosts to true since nginx handles Host header
validation. The previous `.${domain}` pattern used the
build-time DOMAIN value, which breaks when the same image
is deployed to a different domain.
Bunker Admin
This commit is contained in:
parent
cbfa4f9e28
commit
d17e197a1b
@ -15,12 +15,11 @@ export default defineConfig({
|
||||
server: {
|
||||
port: 3000,
|
||||
host: '0.0.0.0',
|
||||
allowedHosts: [
|
||||
`.${domain}`, // Allow all subdomains of configured domain
|
||||
'changemaker-v2-admin', // Allow container hostname
|
||||
'localhost',
|
||||
'127.0.0.1',
|
||||
],
|
||||
// Allow all hosts — nginx handles Host header validation in production.
|
||||
// Vite's allowedHosts only sees the build-time DOMAIN value, which may
|
||||
// differ from the runtime domain (e.g., image built for cmlite.org but
|
||||
// deployed to wokemail.org).
|
||||
allowedHosts: true,
|
||||
proxy: {
|
||||
'/api': {
|
||||
// Use env var with fallback: Docker uses container name, local uses localhost
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user